HTTP Status Codes Cheatsheet
Every HTTP status code explained: from 100s to 500s, with what each code means and exactly when to use it.61 commands · 5 sections
HTTP status codes tell clients whether a request succeeded, failed, or needs action. This cheatsheet covers every code class: informational 1xx, success 2xx, redirection 3xx, client errors 4xx, and server errors 5xx.
Each entry shows the code, its meaning, and the use case: when your API should return it and what clients should do with it.
1xx Informational4
100 Continue101 Switching Protocols102 Processing103 Early Hints2xx Success9
200 OK201 Created202 Accepted204 No Content205 Reset Content206 Partial Content207 Multi-Status208 Already Reported226 IM Used3xx Redirection7
300 Multiple Choices301 Moved Permanently302 Found303 See Other304 Not Modified307 Temporary Redirect308 Permanent Redirect4xx Client Errors29
400 Bad Request401 Unauthorized402 Payment Required403 Forbidden404 Not Found405 Method Not Allowed406 Not Acceptable407 Proxy Authentication Required408 Request Timeout409 Conflict410 Gone411 Length Required412 Precondition Failed413 Payload Too Large414 URI Too Long415 Unsupported Media Type416 Range Not Satisfiable417 Expectation Failed418 I'm a teapot421 Misdirected Request422 Unprocessable Entity423 Locked424 Failed Dependency425 Too Early426 Upgrade Required428 Precondition Required429 Too Many Requests431 Request Header Fields Too Large451 Unavailable For Legal Reasons5xx Server Errors12
500 Internal Server Error501 Not Implemented502 Bad Gateway503 Service Unavailable504 Gateway Timeout505 HTTP Version Not Supported506 Variant Also Negotiates507 Insufficient Storage508 Loop Detected510 Not Extended511 Network Authentication Required520-527 (Cloudflare-specific)HTTP Status Codes Cheatsheet
Every HTTP status code explained: from 100s to 500s, with what each code means and exactly when to use it.
HTTP status codes tell clients whether a request succeeded, failed, or needs action. This cheatsheet covers every code class: informational 1xx, success 2xx, redirection 3xx, client errors 4xx, and server errors 5xx.
Each entry shows the code, its meaning, and the use case: when your API should return it and what clients should do with it.
1xx Informational
100 Continue: Server received headers, client may send the body: large uploads.101 Switching Protocols: Upgrade to WebSocket or HTTP/2: connection protocol change.102 Processing: Server is still working: long operations (WebDAV).103 Early Hints: Send <link rel="preload"> headers before the final response: faster page loads.2xx Success
200 OK: Request succeeded: the default success for GET, PUT, PATCH.201 Created: A resource was created: return with Location header.202 Accepted: Accepted for async processing: job queues, webhooks.204 No Content: Success with an empty body: deletions and silent updates.205 Reset Content: Tell the client to reset the document view: form resets.206 Partial Content: Partial response: range requests, video streaming, resumable downloads.207 Multi-Status: Mixed statuses in one body: batch operations (WebDAV).208 Already Reported: Resource already listed earlier in a DAV response.226 IM Used: Server applied instance manipulation (delta encoding).3xx Redirection
300 Multiple Choices: Multiple representations available: rarely used; pick one and redirect.301 Moved Permanently: Permanent redirect: update bookmarks, link equity passes, method may change to GET.302 Found: Temporary redirect: browser keeps the original URL and method.303 See Other: Redirect to GET after a POST: PRG (Post/Redirect/Get) pattern.304 Not Modified: Cache is still valid: respond with ETag/Last-Modified checks.307 Temporary Redirect: Temporary redirect KEEPING the method and body: unlike 302.308 Permanent Redirect: Permanent redirect KEEPING method and body: POST stays POST.4xx Client Errors
400 Bad Request: Malformed request: bad JSON, invalid syntax. The client must fix it.401 Unauthorized: Not authenticated: missing or invalid credentials. Retry WITH auth.402 Payment Required: Reserved for digital payments: rarely used.403 Forbidden: Authenticated but NOT allowed: no access to this resource.404 Not Found: Resource does not exist: or is hidden for security.405 Method Not Allowed: Wrong method for this route: return Allow header.406 Not Acceptable: Cannot produce the requested Accept format.407 Proxy Authentication Required: Must authenticate with the proxy first.408 Request Timeout: Client took too long to send the request: server gave up.409 Conflict: Request conflicts with the current state: version conflicts, duplicate create.410 Gone: Resource existed but was removed permanently: no retry.411 Length Required: Content-Length header missing where required.412 Precondition Failed: Conditional headers (If-Match, If-None-Match) failed: optimistic locking.413 Payload Too Large: Request body exceeds the server limit.414 URI Too Long: URL too long: often GET requests with huge query strings.415 Unsupported Media Type: Content-Type is not supported by the endpoint.416 Range Not Satisfiable: Range header does not match the resource: return Content-Range.417 Expectation Failed: The Expect header's expectation cannot be met.418 I'm a teapot: A joke from RFC 2324: occasionally used as an easter egg.421 Misdirected Request: Request sent to a server that cannot respond: shared hosting, SNI issues.422 Unprocessable Entity: Request is valid JSON but semantically invalid: validation errors.423 Locked: Resource is locked (WebDAV).424 Failed Dependency: Request depends on another request that failed (WebDAV).425 Too Early: Server refuses the request: potential replay attack risk.426 Upgrade Required: Client must switch protocols: upgrade to HTTP/2 or TLS.428 Precondition Required: Server requires If-Match/If-None-Match: prevents lost updates.429 Too Many Requests: Rate limited: include Retry-After header. THE rate-limit code.431 Request Header Fields Too Large: Headers exceed the server limit: cookie or auth bloat.451 Unavailable For Legal Reasons: Blocked by legal requirements: censorship and takedowns.5xx Server Errors
500 Internal Server Error: Unexpected server failure: do NOT leak details in the body.501 Not Implemented: Server does not support the requested feature: method not implemented.502 Bad Gateway: Upstream server returned an invalid response: nginx behind a broken app.503 Service Unavailable: Server is overloaded or down for maintenance: include Retry-After.504 Gateway Timeout: Upstream took too long: proxy timed out waiting.505 HTTP Version Not Supported: The HTTP version in the request is not supported.506 Variant Also Negotiates: Transparent content negotiation misconfigured (rare).507 Insufficient Storage: Server cannot store the representation: disk full (WebDAV).508 Loop Detected: Infinite processing loop detected (WebDAV).510 Not Extended: Further extensions required to fulfill the request (rare).511 Network Authentication Required: Client must authenticate to the NETWORK: captive portals.520-527 (Cloudflare-specific): Cloudflare-specific errors: 520 unknown, 521 down, 522 timeout, 523 unreachable, 524 timeout, 525 SSL, 526 invalid SSL, 527 Railgun.Frequently asked questions
What does a 404 status code mean?
404 Not Found means the server cannot find the requested resource. Unlike 410 Gone, the resource may exist again later, so 404 is the correct response for unknown or removed URLs you do not want to signal permanently.
What is the difference between 301 and 302 redirects?
301 Moved Permanently tells clients and search engines the URL has permanently changed: bookmarks and link equity are updated. 302 Found is a temporary redirect used for short-lived moves; browsers keep the original URL.
When should I return 429?
Return 429 Too Many Requests when a client exceeds your rate limit. Include a Retry-After header so clients know when to try again, and use the response to trigger backoff logic on the client.
What is the difference between 401 and 403?
401 Unauthorized means the request lacks valid authentication: send credentials and retry. 403 Forbidden means authentication succeeded but the user lacks permission for that resource. 401 is about identity, 403 about access.