Cheat Sheets
HTTP Status Codes
A quick reference to the HTTP status codes you will actually meet while building and debugging APIs: grouped by class, with the official name, a one-line meaning and where each one shows up in practice.
HTTP status codes are not arbitrary numbers. They are part of the HTTP semantics defined in RFC 9110, and each code carries a registered meaning that clients, proxies and caches rely on when they decide how to react to a response. The first digit places the response into one of five classes: 1xx for informational, 2xx for success, 3xx for redirection, 4xx for client errors and 5xx for server errors. The authoritative list, including reserved and unassigned entries, is maintained by IANA in its HTTP Status Code Registry. This cheat sheet follows the registered names and demonstrates the boundary cases where servers and clients commonly disagree. When a code is missing here, the registry is the first place to check before guessing.
1xx · Informational
4 codesThe request was received and is being processed; the client can keep going.
Informational responses are transitional. They are sent before the final response while the server is still working, so the client knows the request arrived and can keep going. 100 Continue works together with the Expect header: a client can ask whether the server will accept a large body before uploading it. 103 Early Hints is newer and lets the server send preliminary Link headers so the browser can preload critical assets before the main body arrives. The boundary to remember is that a 1xx code never ends the exchange. This is why they appear in raw network traces but seldom in application code; fetch() and XMLHttpRequest surface only the final response, which is the behavior MDN documents for status handling.
Continue
Server received the request headers and the client should send the body.
Use case: Large uploads where the server confirms headers before the payload is sent.
Switching Protocols
Server is switching to a different protocol as requested via the Upgrade header.
Use case: WebSocket handshakes that upgrade HTTP to a persistent socket.
Processing
Server received the request and is still working; no final response yet.
Use case: Long-running WebDAV operations to keep the client from timing out.
Early Hints
Server sends preliminary headers before the final response so the client can start early.
Use case: Sending Link headers to preload critical assets before the body arrives.
2xx · Success
7 codesThe request was received, understood and accepted.
Success responses share one property: the request was understood and accepted. The specific code records what kind of success happened. 200 OK returns the requested representation, 201 Created reports a new resource and should point to it with a Location header, 202 Accepted defers the real work, 204 No Content succeeds without a body and is the natural answer for DELETE, and 206 Partial Content returns only the byte range requested through a Range header and adds a Content-Range header for the full size. Picking the narrowest code matters. A 201 tells the client which resource to load next, a 204 keeps the current view intact, and a 206 keeps a resumable download alive, so flattening everything into 200 throws that information away.
OK
The request succeeded; the body carries the requested data.
Use case: Standard success response for GET, PUT and most read operations.
Created
The request succeeded and a new resource was created.
Use case: POST responses that return the newly created resource and its Location.
Accepted
The request was accepted for processing but has not completed yet.
Use case: Asynchronous jobs and queues where work happens after the response.
Non-Authoritative Information
The response came from a proxy or cache and may differ from the origin.
Use case: Transformers or CDNs returning a modified copy of the original payload.
No Content
The request succeeded but there is no body to return.
Use case: DELETE and fire-and-forget updates where a body is unnecessary.
Reset Content
The request succeeded; the client should reset the form or view that sent it.
Use case: Form submissions that should clear their fields after success.
Partial Content
The server returns only part of the resource requested by a Range header.
Use case: Resumable downloads and streaming video or audio in chunks.
3xx · Redirection
6 codesThe client must take further action, usually by following a new location.
Redirection tells the client to look elsewhere, usually at the URI carried by the Location header, and the exact code controls what happens to the request method. 301 Moved Permanently and 308 Permanent Redirect mark a lasting move, while 302 Found and 307 Temporary Redirect cover a temporary one. The subtle part is method preservation: RFC 9110 notes that many historical clients rewrite the method of a 301 or 302 response to GET, which is exactly why 307 and 308 were defined to keep the method and body intact. 303 See Other explicitly tells the client to fetch the result with GET, and 304 Not Modified is the caching case: it carries no body and tells the client its stored copy is still valid.
Multiple Choices
There are several possible responses and the client must pick one.
Use case: Content negotiation where multiple representations are available.
Moved Permanently
The resource has permanently moved to a new URL; update bookmarks and links.
Use case: SEO-friendly permanent redirects that pass link equity to the new URL.
Found
The resource temporarily lives at another URL; keep using the original next time.
Use case: Temporary redirects and legacy login flows that bounce between pages.
Not Modified
The cached copy is still valid, so no response body is sent.
Use case: Conditional GET requests with ETag or Last-Modified to save bandwidth.
Temporary Redirect
Temporarily redirect while preserving the request method and body.
Use case: Redirecting POST submissions without silently changing the HTTP verb.
Permanent Redirect
Permanently redirect while preserving the method and body.
Use case: Permanent redirects that must keep POST or PUT semantics intact.
4xx · Client Error
16 codesThe request is malformed, unauthorized or references a missing resource.
Client errors say the request itself is the problem. 400 Bad Request covers malformed syntax, while 422 Unprocessable Content, standardized in RFC 9110, means the message is well formed but fails the application's business rules. 401 Unauthorized asks for authentication and carries a WWW-Authenticate header, whereas 403 Forbidden means the server knows who you are but refuses the action. 404 Not Found is also the privacy-friendly answer, because it avoids confirming whether a resource exists, and 410 Gone goes further by stating the resource used to exist. 429 Too Many Requests should send Retry-After so clients know when to back off, and 405 Method Not Allowed should list the allowed methods in an Allow header. A common source of confusion is mixing 400 with 422: if the JSON is syntactically valid but the values fail business rules, the correct signal is 422, not 400. Just as important, a 4xx code should never leak stack traces or database error text, since these responses may be cached or forwarded.
Bad Request
The server could not understand the request due to malformed syntax.
Use case: Invalid JSON bodies or missing required fields in a request.
Unauthorized
Authentication is required, or the provided credentials are missing or invalid.
Use case: Protected endpoints that require a valid token before access.
Payment Required
Reserved for future use; historically intended for digital payment.
Use case: Rarely used in practice; some paywalled APIs repurpose this status.
Forbidden
The server understood the request but refuses to authorize it.
Use case: Authenticated users trying to access a resource they lack permission for.
Not Found
The requested resource does not exist at this URL.
Use case: Unknown routes, mistyped URLs or records that have been deleted.
Method Not Allowed
The HTTP method is not supported for this resource.
Use case: Sending a GET to an endpoint that only accepts POST.
Not Acceptable
No available representation satisfies the client’s Accept headers.
Use case: Content negotiation failures when the client asks for an unsupported format.
Request Timeout
The server timed out waiting for the client to finish the request.
Use case: Slow or incomplete client uploads that exceed the server timeout.
Conflict
The request conflicts with the current state of the resource.
Use case: Duplicate records or optimistic-locking failures during concurrent writes.
Gone
The resource was intentionally removed and will not return.
Use case: Permanently deleted endpoints, distinct from a temporary 404.
Payload Too Large
The request body exceeds the size limit the server will accept.
Use case: Oversized file uploads rejected by a configured size cap.
URI Too Long
The request URL is longer than the server is willing to process.
Use case: Extremely long query strings that exceed server URL limits.
Unsupported Media Type
The media type of the request body is not supported.
Use case: Sending text/plain to a JSON API that expects application/json.
I'm a teapot
An April Fools’ RFC joke; the server refuses to brew coffee.
Use case: Easter eggs, API smoke tests and protocol trolling.
Unprocessable Entity
The request is well-formed but semantically invalid.
Use case: Validation errors on well-formatted input that fails business rules.
Too Many Requests
The client sent too many requests and is being rate limited.
Use case: Rate-limit and throttle responses that ask the client to back off.
5xx · Server Error
6 codesThe server failed to fulfill a request that otherwise appeared valid.
Server errors announce that the failure happened on the serving side, no matter what the client sent. 500 Internal Server Error is the catch-all for unhandled exceptions, 501 Not Implemented means the server does not support the requested functionality, and 505 HTTP Version Not Supported, defined in RFC 9112, rejects a protocol version the server cannot speak. The gateway codes describe the position of the failure: 502 Bad Gateway means a proxy received an invalid response from an upstream server, 503 Service Unavailable means the server is temporarily overloaded or down for maintenance and should pair with Retry-After, and 504 Gateway Timeout means the upstream never answered in time. Collapsing every failure into 500 hides all of that diagnostic value.
Internal Server Error
A generic error occurred on the server with no more specific message.
Use case: Unhandled exceptions or unexpected failures in application code.
Not Implemented
The server does not support the requested functionality.
Use case: Unsupported methods or features that the server has not built.
Bad Gateway
The server, acting as a gateway, got an invalid response upstream.
Use case: Reverse proxies or CDNs when the origin returns a broken response.
Service Unavailable
The server is temporarily overloaded or down for maintenance.
Use case: Maintenance windows, overload protection and rolling deployments.
Gateway Timeout
The upstream server did not respond within the allowed time.
Use case: Slow backends behind a proxy that exceed the timeout budget.
HTTP Version Not Supported
The server does not support the HTTP version used in the request.
Use case: Legacy or malformed requests using an unsupported protocol version.
A few habits cause most status code confusion. Returning 200 for paths that are really redirects or errors, using 401 and 403 interchangeably, ignoring the Retry-After header that 429 and 503 should carry, and sending 404 for every unknown route even when 410 or a guard endpoint would be clearer. When an API needs a meaning the registry does not list, the safe approach is to reuse the closest registered code and put the detail in the response body, because clients only understand registered semantics. For redirects, remember the method issue above: use 307 and 308 when the method and body must survive the hop, and 303 when the client should re-fetch with GET. The table above is the quick map, and the sources below define every entry in it.
The HTTP standards and registry behind these status codes
Each entry below is the source behind the corresponding claims in this page.
- IANA HTTP Status Code Registry The official source for every number and name in this table, including reserved and unassigned codes.
- RFC 9110, HTTP Semantics Defines the five status classes, the 100 Continue and Expect interaction, the 301/302 method rewriting note and the Retry-After rules cited above.
- RFC 9112, HTTP/1.1 The base for 505 HTTP Version Not Supported and the message framing rules behind the 1xx and 2xx notes above.
- MDN, HTTP response status codes MDN’s developer-facing reference for each code, including the client-side behavior of fetch() and redirect handling described in this page.