HTTP Status Codes
Browse every HTTP status code with its meaning, typical cause, and how to fix it. Searchable reference for developers.
A searchable reference to every standard HTTP status code with its meaning, typical cause, and the fix that actually helps — compiled from the modern RFCs, with the 4xx client errors and 5xx server errors separated so blame lands on the right side.
How to use HTTP Status Codes
- Type a code or a word from the error you saw.
- Read the entry: class, meaning, and the practical fix.
- Follow the fix — most 4xx point at the request, most 5xx at the server.
Who it is for
Developers reading an API error for the first time, support teams translating status codes for customers, students learning the protocol, and interview candidates who want the definitions straight.
How it works
- All standard codes from 100 Continue to 508 plus the special cases (418 included) with one-line, cause-and-fix descriptions.
- Search matches by code, name, or meaning — type "rate" and find 429; type "404" and find Not Found.
- Each entry labels its class (informational, success, redirection, client, server) so the responsibility split is visible.
What it cannot do
- It is a reference, not a diagnostic — it explains what a code means, not why YOUR server returned it.
- Vendor-specific codes outside the RFCs are omitted on purpose.
Sample input & output
Search query: "502" or "upstream"
502 Bad Gateway (5xx Server Error) — Reverse proxy or CDN received an invalid response from the origin server; check PHP-FPM/Node process health, socket permissions, and upstream timeouts.
Frequently asked questions
What is the difference between 401 and 403?
401 means "who are you?" (authentication missing or invalid); 403 means "I know who you are and you may not" (authorisation failed).
Is 429 always rate limiting?
Yes — and the Retry-After header tells you how long to wait. Backing off is the correct client behaviour.
Why include 418?
It is the RFC 2324 joke status that real services occasionally return — omitting it would make the reference incomplete.
What is the practical difference between 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway Timeout?
Under IETF RFC 9110 (HTTP Semantics), all three occur at the server or reverse-proxy boundary for distinct failure modes. A 502 means Nginx, Cloudflare, or an ALB reached an upstream backend that crashed or returned malformed bytes; 504 means the upstream stayed silent past proxy_read_timeout; and 503 means the server intentionally refused work due to overload or maintenance, often supplying a Retry-After header.
When should a redirect use 301, 302, 307, or 308 for API endpoints and SEO?
Legacy 301 (Moved Permanently) and 302 (Found) allow browsers to rewrite POST requests into GET on follow-up, dropping request bodies on form or webhook endpoints. RFC 9110 defines 307 (Temporary Redirect) and 308 (Permanent Redirect) to strictly preserve the original HTTP method and body. Use 301 or 308 for permanent SEO URL migrations so search engines transfer link equity, and 307 for temporary maintenance routing.
How do 400 Bad Request, 409 Conflict, and 422 Unprocessable Content differ in REST APIs?
Return 400 when the client sends syntactically broken wire data — truncated JSON, invalid percent-encoding, or missing required headers. Return 422 (standardized in RFC 9110 Section 15.5.21) when the JSON parses cleanly on the wire but fails domain validation, such as a negative quantity or invalid date range. Reserve 409 Conflict for state collisions like duplicate unique keys or stale optimistic-concurrency ETag versions.
Why does HTTP 204 No Content forbid a response body and break JSON parsers that call res.json()?
By RFC 9110 definition, a 204 No Content response terminates immediately after the header blank line and MUST NOT include a message body, making it standard for DELETE operations and background autosave PUT calls. Calling response.json() unconditionally in Fetch on a 204 response throws "Unexpected end of JSON input" because zero bytes arrived; always check response.status === 204 before parsing.