HTTP Status Code Cheat Sheet (1xx-5xx)
A practical reference for HTTP status codes — not just the textbook definition but real-world guidance: which code is right for "user tried to access something they don't own" (403 vs 404), when 422 makes sense over 400, the difference between 502 and 503. Searchable by code or use case.
How to use the HTTP Status Code Cheat Sheet (1xx-5xx)
Browse or filter by code, name, or use case. Each entry has the standard definition plus a "when to use" note and common alternatives to consider.
Choosing the right status code
HTTP status codes have crisp definitions but blurry edges in practice. Should a request for a resource the user does not own return 403 or 404? Is a validation failure a 400 or a 422? What separates a 502 from a 503? The textbook RFC text rarely answers these, and picking the wrong code makes an API harder to consume and debug.
This is a practical reference: every code with its IANA category, a plain “when to use” note, and the common alternatives worth considering, all searchable by number or by intent. For a fast single-code lookup when you already know the number, the HTTP status lookup is quicker; to understand the headers that travel with a response, see the HTTP headers explainer.
Common use cases
- API design — pick the most accurate code for each response.
- Settling debates — decide 403 versus 404, or 400 versus 422.
- Code review — check that handlers return sensible statuses.
- Debugging — understand what a code your client received implies.
- Learning — browse the full range with real-world guidance.