HTTP Status Codes
Every HTTP status code in plain words, from 100 to 511, plus common nginx and Cloudflare codes, with tips for each.
Runs in your browser. Nothing is uploaded.
1xx Informational The request was received and work continues.
100 Continue
The server has received the request headers and the client can send the body.
Used with Expect: 100-continue before uploading a large body, so a request that will be rejected is not sent in full.
101 Switching Protocols
The server agrees to switch to the protocol the client asked for in the Upgrade header.
Seen when a connection is upgraded to WebSocket.
102 Processingdeprecated
The server has accepted a WebDAV request and is still working on it.
Rare today; prevents clients from timing out on long WebDAV operations.
103 Early Hints
Preliminary headers sent before the final response, usually Link headers for resources to preload.
Lets browsers start fetching CSS and fonts while the server is still building the page.
2xx Success The request worked.
200 OK
The request succeeded and the response contains the result.
The normal answer for a successful GET, or a POST that returns data.
201 Created
The request succeeded and a new resource was created.
Return it after creating something with POST or PUT, with a Location header pointing to the new resource.
202 Accepted
The request was accepted for processing, but the work is not finished yet.
Use it for queued or background jobs, and give the client a way to check progress.
203 Non-Authoritative Information
The response was changed by a proxy in between and is not exactly what the origin server sent.
Rarely used in practice.
204 No Content
The request succeeded and there is no body to return.
Common for DELETE and for updates that do not need to send data back.
205 Reset Content
The request succeeded and the client should reset the form or view that sent it.
Rarely used.
206 Partial Content
The server is sending only part of the resource, as asked by a Range header.
Used for resuming downloads and for seeking in video and audio.
207 Multi-Status
The body contains separate status codes for several resources (WebDAV).
Seen with WebDAV and some batch APIs.
208 Already Reported
Members of a WebDAV collection were already listed earlier in the same response.
Used inside 207 responses to avoid repeating items.
226 IM Used
The server returned the result of changes (a delta) applied to the resource.
Part of delta encoding for HTTP; very rare.
3xx Redirection The client needs to go somewhere else or use its cache.
300 Multiple Choices
There are several versions of the resource and the client should pick one.
Rarely used; most sites choose for the user instead.
301 Moved Permanently
The resource has a new permanent URL, given in the Location header.
The standard redirect for changed URLs. Search engines move rankings to the new URL. Browsers may change POST to GET.
302 Found
The resource is temporarily at another URL.
Use for short-term redirects. Browsers usually change POST to GET; use 307 to keep the method.
303 See Other
The result can be found at another URL, which the client should fetch with GET.
Used after a form submission to send the user to a results page (post/redirect/get).
304 Not Modified
The cached copy the client already has is still up to date.
Sent in answer to If-None-Match or If-Modified-Since; saves bandwidth.
305 Use Proxydeprecated
The resource must be accessed through a proxy.
Deprecated for security reasons; browsers ignore it.
307 Temporary Redirect
The resource is temporarily at another URL, and the client must repeat the same method and body.
Like 302, but a POST stays a POST. Also used by browsers for HSTS upgrades to HTTPS.
308 Permanent Redirect
The resource has a new permanent URL, and the client must repeat the same method and body.
Like 301, but keeps POST as POST. Good for APIs.
4xx Client error Something is wrong with the request.
400 Bad Request
The server could not understand the request, for example because of invalid syntax or a malformed body.
Check the JSON, query parameters and headers you send.
401 Unauthorized
Authentication is required and was missing or invalid.
Send valid credentials or a token. Despite the name, it means "not authenticated".
402 Payment Required
Reserved for future use; some services use it when a payment or subscription is needed.
Not standardised in detail; check the service’s documentation.
403 Forbidden
The server understood who you are but refuses the request.
Logging in again will not help; you need different permissions, or the resource is blocked.
404 Not Found
There is nothing at this URL, or the server will not say whether there is.
Check the URL for typos. Use 410 if the resource was deleted on purpose.
405 Method Not Allowed
The URL exists but does not accept this method, for example POST to a read-only page.
The Allow header lists the methods that work.
406 Not Acceptable
The server cannot produce a response in any format the client accepts (Accept headers).
Relax the Accept header or ask for a format the API supports.
407 Proxy Authentication Required
A proxy between client and server requires authentication.
Configure proxy credentials in your client or network settings.
408 Request Timeout
The server gave up waiting for the client to finish sending the request.
Often caused by a slow network. Retrying usually works.
409 Conflict
The request conflicts with the current state of the resource.
Typical for edit conflicts or creating something that already exists.
410 Gone
The resource was removed on purpose and will not come back.
Tells search engines to drop the URL faster than 404.
411 Length Required
The server needs a Content-Length header for this request.
Send the body length, or use a client that sets it automatically.
412 Precondition Failed
A condition in the request headers, such as If-Match, was not met.
Used to stop lost updates: someone else changed the resource first.
413 Content Too Large
The request body is larger than the server will accept.
Upload a smaller file or raise the server limit (for example client_max_body_size in nginx).
414 URI Too Long
The URL is longer than the server will handle.
Move large data from the query string into a POST body.
415 Unsupported Media Type
The server does not accept the format of the request body.
Check the Content-Type header, for example application/json.
416 Range Not Satisfiable
The requested byte range is outside the size of the resource.
Seen when resuming a download of a file that changed.
417 Expectation Failed
The server cannot meet the requirement in the Expect header.
Remove Expect: 100-continue if the server does not support it.
418 I'm a teapot
An April Fools’ joke from 1998: the server is a teapot and refuses to brew coffee.
Sometimes used for fun or to turn away unwanted requests.
421 Misdirected Request
The request reached a server that cannot answer for this host name.
Can happen with shared TLS connections across several domains.
422 Unprocessable Content
The request is well-formed but its content fails validation.
Common in APIs for form errors; the body usually lists the invalid fields.
423 Locked
The resource is locked (WebDAV).
Wait for the lock to be released.
424 Failed Dependency
The request failed because an earlier request it depended on failed (WebDAV).
Fix the first failure in the batch.
425 Too Early
The server will not process a request that might be replayed, sent in TLS early data.
The client should retry after the handshake completes.
426 Upgrade Required
The client must switch to another protocol, named in the Upgrade header.
For example, a newer TLS or HTTP version.
428 Precondition Required
The server requires a conditional request, such as one with If-Match.
Prevents accidental overwrites in APIs.
429 Too Many Requests
The client has sent too many requests in a given time (rate limiting).
Slow down. The Retry-After header often says how long to wait.
431 Request Header Fields Too Large
The headers are too large, often because of big cookies.
Clear cookies for the site or reduce custom headers.
444 No Responsenginx only
nginx closed the connection without sending anything.
Used to drop unwanted or malicious requests.
451 Unavailable For Legal Reasons
The resource cannot be shown because of a legal demand.
Named after the novel Fahrenheit 451.
499 Client Closed Requestnginx only
The client closed the connection before nginx could reply.
Often a user leaving the page, or a client timeout shorter than the server’s.
5xx Server error The server failed to handle a valid request.
500 Internal Server Error
Something went wrong on the server, and it has no more specific code.
Not your fault as a visitor. Developers should check the server logs.
501 Not Implemented
The server does not support the feature needed to answer, such as an unknown method.
The request may be fine for a different server or API version.
502 Bad Gateway
A gateway or proxy got an invalid response from the server behind it.
Usually the application server is down or crashed. Check it and the proxy logs.
503 Service Unavailable
The server is temporarily unable to handle requests, for example during maintenance or overload.
Send Retry-After. Search engines keep pages indexed during short 503 periods.
504 Gateway Timeout
A gateway or proxy did not get a response from the server behind it in time.
The application is too slow or hung. Check slow queries and timeouts.
505 HTTP Version Not Supported
The server does not support the HTTP version used in the request.
Rare; check client and proxy settings.
506 Variant Also Negotiates
A server configuration error in content negotiation creates a loop.
Rare; a server misconfiguration.
507 Insufficient Storage
The server cannot store what is needed to complete the request (WebDAV).
The server’s disk or quota is full.
508 Loop Detected
The server found an infinite loop while processing the request (WebDAV).
Rare; caused by circular bindings.
510 Not Extendeddeprecated
Further extensions to the request are required.
Historic and rarely seen.
511 Network Authentication Required
You must sign in to the network before you can browse, as on hotel or airport Wi-Fi.
Open any page in a browser to reach the sign-in page.
520 Web Server Returned an Unknown ErrorCloudflare only
Cloudflare got an empty or unexpected response from the origin server.
Check the origin server for crashes or oversized headers.
521 Web Server Is DownCloudflare only
Cloudflare could not connect to the origin server.
The origin is down or blocks Cloudflare’s addresses.
522 Connection Timed OutCloudflare only
Cloudflare connected to the origin network but the server did not answer in time.
Check firewalls and server load.
523 Origin Is UnreachableCloudflare only
Cloudflare could not reach the origin, often because of DNS problems.
Check the DNS records for the origin.
524 A Timeout OccurredCloudflare only
Cloudflare connected but the origin took too long to send a response.
Speed up slow requests or move long jobs to the background.
525 SSL Handshake FailedCloudflare only
Cloudflare could not complete a TLS handshake with the origin.
Check the origin’s certificate and TLS settings.
526 Invalid SSL CertificateCloudflare only
The origin’s certificate could not be validated.
Install a valid certificate on the origin.
No status code matches. Try a number like 403 or a word like “timeout”.
How to use the HTTP Status Codes
- Type a code, such as 404 or 503, to jump straight to it.
- Type a class such as 4xx or 5 to see a whole group.
- Search with words, such as “redirect”, “rate limit” or “timeout”, to find the right code by its meaning.
- Untick Include nginx and Cloudflare codes to see only standard codes.
- Read what each code means and the tip on when you see it or what to do.
What a status code is telling you
Every response from a web server starts with a three-digit status code. Browsers usually hide it, but it appears on error pages, in developer tools, in server logs and in every API response. The code says whether the request worked and, if not, whose problem it is. This reference explains every standard code in plain words, plus the non-standard ones you are likely to meet, with a practical tip for each.
The five classes
- 1xx Informational: the request is in progress, as with an upgrade to WebSocket or early hints for preloading.
- 2xx Success: it worked. 200 OK and 201 Created are the most common, and 204 means success with nothing to send back.
- 3xx Redirection: go elsewhere, or use your cached copy. 301 and 308 are permanent moves, 302 and 307 temporary, and 304 tells the browser its cache is still fresh.
- 4xx Client error: something about the request is wrong, such as a missing page (404), no permission (403), not signed in (401), invalid data (400, 422) or too many requests (429).
- 5xx Server error: the server failed. 500 is a general error, 502 and 504 point at a proxy and the application behind it, and 503 means temporarily unavailable.
Search the way you think
Search by number, by class (4xx), or by words describing the situation, such as “too many
requests” or “gateway”. Each entry shows the code, its official name, what it means and when you are
likely to see it. Codes from nginx (444, 499) and Cloudflare (520–526) are included and labelled,
because they turn up in real logs and error pages; untick the option to hide them. Each code also has
its own anchor, so you can link to it, for example #code-429.
For people building websites and APIs
Choosing the right code helps browsers, search engines and API clients do the right thing: cache, retry, redirect or show a useful message. When moving pages, generate redirect rules with the Redirect Generator. For file types in the Content-Type header, see the MIME Type Lookup.
Frequently asked questions
What do the first digits mean?
1xx codes are informational, 2xx mean success, 3xx mean redirection, 4xx mean the request had a problem, and 5xx mean the server failed. The first digit tells you who should act.
What is the difference between 401 and 403?
401 means you are not signed in, or your credentials are wrong; signing in may fix it. 403 means the server knows who you are and still refuses; signing in again won’t help.
Should a missing page return 404 or 410?
Use 404 when a page doesn’t exist or you’re unsure. Use 410 when it was removed deliberately and won’t return; search engines drop it a little faster.
Why are 499 and 520 not in the HTTP standard?
They are used by specific software, nginx and Cloudflare, to report situations the standard doesn’t cover. They appear in logs and error pages, so they are included and marked.
Which code should an API return for validation errors?
422 Unprocessable Content is common for well-formed requests with invalid data, and 400 for requests the server can’t parse at all. Be consistent across your API.
Tutorials
How to choose the right HTTP status codes for an API
Pick clear status codes for success, validation errors, missing records, permissions, rate limits and server failures in a JSON API.