HTTP Status Code Lookup

Search every HTTP status code with practical guidance on when to use it.

API Runs in your browser Shareable link
Search

Runs entirely in your browser. Your data isn't uploaded — this page makes no network request with anything you type, which you can verify in your browser's network tab. How this works.

What is the HTTP Status Code Lookup?

HTTP status codes are a small, stable vocabulary that carries a lot of meaning, and most arguments about them are really about the handful of distinctions that matter: 401 versus 403, 400 versus 422, 301 versus 308, 502 versus 504.

This reference lists every standard code with its specification definition and, more usefully, practical guidance on when to return it, whether the response may carry a body, and whether it is cacheable by default.

How to use it

  1. Type a code, or a word from its name, into the search box.
  2. Filter by class — 1xx informational through 5xx server error.
  3. Open a code to see the specification wording, practical guidance and related codes it is often confused with.

Example

Looking up 409.

Input
409
Result
409 Conflict
The request conflicts with the current state of the target resource.

Return it when: an optimistic-concurrency check failed, or a uniqueness
constraint was violated. Include enough detail for the client to resolve it.
Body allowed: yes.  Cacheable: no.

Features

  • Every IANA-registered status code, plus widely used unofficial ones
  • Search by number, name or symptom
  • Practical "return this when" guidance, not just the specification text
  • Cacheability and body-allowed notes
  • Side-by-side comparison of commonly confused pairs

Frequently asked questions

What is the difference between 401 and 403?
401 means the request was not authenticated — no credentials, or invalid ones — and must include a WWW-Authenticate header telling the client how to authenticate. 403 means the request was authenticated but the identity is not permitted to do this. Retrying with credentials helps for 401 and never helps for 403.
400 or 422 for a validation error?
Both are defensible. 400 is the general-purpose choice and is understood everywhere; 422 (from WebDAV, and adopted widely by REST APIs) signals that the syntax was fine but the content was semantically wrong. Pick one and be consistent across your API.
502 or 504?
502 Bad Gateway means the upstream returned something invalid or the connection failed. 504 Gateway Timeout means the upstream did not respond in time. In practice, 502 points at the upstream being broken or unreachable, 504 at it being slow.
Which redirect should I use?
301 and 308 are permanent, 302 and 307 temporary. The newer 307 and 308 guarantee the method and body are preserved; 301 and 302 are widely implemented as converting a POST to a GET. Use 308 or 307 for anything that is not a GET.
Esc

Loading the catalog…