HTTP Status Codes
About this tool
About HTTP Status Codes
A quick, searchable reference for every standard HTTP status code, from 100 Continue to 511 Network Authentication Required, written for people building and debugging APIs. Each entry explains what the code means, when a server should return it instead of a similar one (401 or 403? 301 or 308? 400 or 422?), and what a client should do: retry immediately, retry later while honouring Retry-After, or fix the request first. You can also see which responses are cacheable by default under RFC 9110 and which specification defines each code. Common non-standard codes are included and clearly labelled, such as nginx's 499 Client Closed Request and Cloudflare's 520 to 526, because they show up in real logs. Search by number or by words like timeout, redirect or rate limit, or filter by class. It is a static page: no lookups are sent anywhere.
Built and maintained by Abhi JainUpdated
Recent changes
- Add CSV/JSON converters, world clock, HTTP reference, and tools UI updates
How to Use the HTTP Status Code Reference
- 1
Search
Type a code (404), a class (5xx) or words (rate limit, redirect) into the search box.
- 2
Filter
Use the class buttons (1xx Informational to 5xx Server error, or Unofficial) to narrow the list.
- 3
Read the details
Open a code to see when to use it, retry guidance, cacheability and the spec, and copy it.
HTTP Status Codes: questions and answers
What is the difference between 401 and 403?
401 Unauthorized means the request has no valid credentials: log in or send a token, and the response must include WWW-Authenticate. 403 Forbidden means the server knows who you are but you are not allowed; logging in again won't help.
Should I use 301 or 308 for a permanent redirect?
Both are permanent and cacheable. 301 lets clients change a POST into a GET when following it; 308 requires the same method and body. Use 308 for API endpoints and 301 for ordinary page moves.
Which HTTP errors should a client retry?
Retry 408, 429, 502, 503 and 504 with exponential backoff, and honour Retry-After when it is sent. Retry 500 only for idempotent requests. Don't retry other 4xx codes: the request itself must change.
What does 502 Bad Gateway mean?
A proxy, load balancer or CDN in front of the site got an invalid response, or none, from the server behind it. The fault is usually the upstream application crashing or refusing connections, not your request.
When should an API return 422 instead of 400?
Use 400 when the request can't be parsed at all, such as malformed JSON. Use 422 Unprocessable Content when it parses but fails validation, such as an email field that isn't an email address.
Related Tools
- HTTP Headers ReferenceSearchable reference of HTTP request and response headers with examples.
- cURL ConverterTurn a cURL command into fetch, Axios, Python, Go, PHP, Node or HTTPie code.
- MIME Type LookupFind the MIME type for a file extension, or the extensions for a MIME type.
- HTTP Request Code GeneratorBuild a request in a form and get cURL, fetch, Axios, HTTPie, Python, Go or PHP code.