HTTP Status Codes Cheat Sheet

All HTTP status codes from 1xx to 5xx — what they mean, when to use them, and common gotchas for API designers.

1xx Info 2xx Success 3xx Redirect 4xx Client Error 5xx Server Error

1xx Informational

CodeNameUse Case
100 Continue Client should continue sending request body
101 Switching Protocols Upgrading to WebSocket
103 Early Hints Preload resources while server prepares response

2xx Success

CodeNameUse Case
200 OK GET/PUT/PATCH success with body
201 Created POST created resource; include Location header
202 Accepted Request accepted for async processing
204 No Content DELETE success or PUT/PATCH with no response body
206 Partial Content Range request (video streaming, resumable downloads)

3xx Redirection

CodeNameUse Case
301 Moved Permanently URL permanently changed; browsers cache this
302 Found Temporary redirect (use 307 for exact method)
303 See Other POST/PUT done; redirect to result with GET
304 Not Modified Client cache still valid (ETag/Last-Modified)
307 Temporary Redirect Temp redirect preserving HTTP method
308 Permanent Redirect Like 301 but preserves HTTP method

4xx Client Errors

CodeNameUse Case
400 Bad Request Malformed syntax, invalid parameters
401 Unauthorized Missing/invalid authentication credentials
403 Forbidden Authenticated but not authorized for this resource
404 Not Found Resource does not exist (or hidden — use 403 if hiding)
405 Method Not Allowed HTTP verb not supported; include Allow header
409 Conflict State conflict (duplicate, version mismatch)
410 Gone Resource permanently deleted (stronger than 404)
422 Unprocessable Entity Validation errors (well-formed but semantically wrong)
429 Too Many Requests Rate limit exceeded; include Retry-After header
451 Unavailable For Legal Reasons Content blocked due to legal requirements

5xx Server Errors

CodeNameUse Case
500 Internal Server Error Generic server-side error (unhandled exception)
501 Not Implemented Server doesn't support the request method
502 Bad Gateway Upstream returned invalid response (proxy/LB)
503 Service Unavailable Server overloaded or down for maintenance
504 Gateway Timeout Upstream didn't respond in time
507 Insufficient Storage Server can't store the representation (WebDAV)
529 Site is Overloaded Cloudflare custom: too many pending connections

More Cheat Sheets