Skip to content

HTTP Status Codes

Every HTTP status code from 100 to 511, with a plain explanation of what it means and when a server sends it. Search by number or words like "redirect" or "rate limit".

1xx · Informational

100Continue

The server got the request headers and the client should send the body. Used with the Expect: 100-continue header so large uploads can be refused early.

RFC 9110
101Switching Protocols

The server agrees to switch protocols as asked in the Upgrade header. Seen when a connection is upgraded to WebSocket.

RFC 9110
102Processing

WebDAV. The server has accepted the request but has not finished it yet. Prevents the client from timing out.

RFC 2518
103Early Hints

Sent before the final response so the browser can start preloading resources listed in Link headers.

RFC 8297

2xx · Success

200OK

The request succeeded. The body holds the result: the resource for GET, or the outcome of the action for POST.

RFC 9110
201Created

A new resource was created. The Location header should point to it. The usual reply to a successful POST that creates something.

RFC 9110
202Accepted

The request was accepted for processing but is not finished. Common for queued or asynchronous jobs.

RFC 9110
203Non-Authoritative Information

The request succeeded, but a proxy changed the returned content from what the origin sent.

RFC 9110
204No Content

The request succeeded and there is no body to return. Common for DELETE and for PUT or PATCH that return nothing.

RFC 9110
205Reset Content

The request succeeded and the client should reset the form or view that sent it.

RFC 9110
206Partial Content

Only the byte range asked for in the Range header is returned. Used for resumable downloads and video streaming.

RFC 9110
207Multi-Status

WebDAV. The body contains separate status codes for several resources.

RFC 4918
208Already Reported

WebDAV. Members of a binding were already listed earlier in the response and are not repeated.

RFC 5842
226IM Used

The server applied instance manipulations, such as a delta encoding, to the resource.

RFC 3229

3xx · Redirection

300Multiple Choices

The resource has several representations and the client should choose one. Rarely used in practice.

RFC 9110
301Moved Permanently

The resource has a new permanent URL given in the Location header. Search engines move ranking to the new URL. Clients may change POST to GET when following it.

RFC 9110
302Found

The resource is temporarily at the URL in the Location header. Clients may change POST to GET. Use 307 if the method must not change.

RFC 9110
303See Other

Fetch the result with a GET to the URL in the Location header. Used after a form POST so refreshing the page does not resubmit it.

RFC 9110
304Not Modified

The cached copy is still valid, so no body is sent. Returned for conditional requests with If-None-Match or If-Modified-Since.

RFC 9110
307Temporary Redirect

Like 302, but the client must repeat the request with the same method and body.

RFC 9110
308Permanent Redirect

Like 301, but the client must repeat the request with the same method and body.

RFC 9110

4xx · Client error

400Bad Request

The server cannot process the request because it is malformed, such as invalid JSON, a missing field or a bad parameter.

RFC 9110
401Unauthorized

Authentication is missing or invalid. The response includes a WWW-Authenticate header. Despite the name, it means "not authenticated".

RFC 9110
402Payment Required

Reserved for future use. Some APIs use it when a plan limit is reached or payment has failed.

RFC 9110
403Forbidden

The server knows who you are but you are not allowed to do this. Logging in again will not help.

RFC 9110
404Not Found

No resource exists at this URL. Also used to hide that a resource exists from users who may not see it.

RFC 9110
405Method Not Allowed

The resource exists but does not support this HTTP method. The Allow header lists the methods that work.

RFC 9110
406Not Acceptable

The server cannot produce a response in any format listed in the Accept headers.

RFC 9110
407Proxy Authentication Required

Like 401, but you must authenticate with the proxy in between.

RFC 9110
408Request Timeout

The server gave up waiting for the client to finish sending the request.

RFC 9110
409Conflict

The request conflicts with the current state of the resource, such as a duplicate unique key or an edit based on an old version.

RFC 9110
410Gone

The resource was deliberately removed and will not come back. Unlike 404, this is permanent.

RFC 9110
411Length Required

The server requires a Content-Length header.

RFC 9110
412Precondition Failed

A condition in headers like If-Match was not met. Used for optimistic locking so you do not overwrite someone else's change.

RFC 9110
413Content Too Large

The request body is larger than the server accepts. Often caused by upload size limits.

RFC 9110
414URI Too Long

The URL is longer than the server will handle. Move large data into the request body.

RFC 9110
415Unsupported Media Type

The server does not accept the Content-Type of the body, for example form data sent to an endpoint that expects JSON.

RFC 9110
416Range Not Satisfiable

The byte range in the Range header is outside the size of the resource.

RFC 9110
417Expectation Failed

The server cannot meet the requirement in the Expect header.

RFC 9110
418I'm a teapot

An April Fools' joke from the Hyper Text Coffee Pot Control Protocol. Some sites use it to refuse requests they think come from bots.

RFC 2324
421Misdirected Request

The request went to a server that cannot answer for this host. Can happen when HTTP/2 connections are reused.

RFC 9110
422Unprocessable Content

The request is well-formed but its content fails validation, such as an invalid email address. Common in REST APIs.

RFC 9110
423Locked

WebDAV. The resource is locked.

RFC 4918
424Failed Dependency

WebDAV. The request failed because an earlier request it depended on failed.

RFC 4918
425Too Early

The server will not process a request that could be replayed, such as one sent as TLS early data.

RFC 8470
426Upgrade Required

The client must switch to a different protocol, given in the Upgrade header.

RFC 9110
428Precondition Required

The server requires a conditional request, such as one with If-Match, to prevent lost updates.

RFC 6585
429Too Many Requests

The client hit a rate limit. The Retry-After header says how long to wait before trying again.

RFC 6585
431Request Header Fields Too Large

The headers are too large, often because of oversized cookies.

RFC 6585
451Unavailable For Legal Reasons

The resource cannot be served for legal reasons, such as a court order or government censorship.

RFC 7725

5xx · Server error

500Internal Server Error

Something went wrong on the server and there is no more specific code. Usually an unhandled exception. Check the server logs.

RFC 9110
501Not Implemented

The server does not support the feature needed to fulfil the request, such as an unknown HTTP method.

RFC 9110
502Bad Gateway

A gateway or proxy got an invalid response from the upstream server. Often means the app behind nginx or a load balancer is down or crashed.

RFC 9110
503Service Unavailable

The server is overloaded or down for maintenance. It is temporary, and Retry-After may say when to try again.

RFC 9110
504Gateway Timeout

A gateway or proxy did not get a response from the upstream server in time. Usually a slow query or a hung upstream service.

RFC 9110
505HTTP Version Not Supported

The server does not support the HTTP version used in the request.

RFC 9110
506Variant Also Negotiates

The server has a configuration error in content negotiation.

RFC 2295
507Insufficient Storage

WebDAV. The server does not have enough storage to complete the request.

RFC 4918
508Loop Detected

WebDAV. The server found an infinite loop while processing the request.

RFC 5842
510Not Extended

The request needs further extensions for the server to fulfil it.

RFC 2774
511Network Authentication Required

You must log in to the network first. Used by captive portals on hotel and airport Wi-Fi.

RFC 6585

Last reviewed:

What is an HTTP status code?

Every HTTP response starts with a three-digit status code that tells the client how the request went, before it reads any headers or body. The first digit gives the class: 1xx informational responses are interim messages, 2xx means success, 3xx asks the client to go somewhere else (redirects and cache revalidation), 4xx means the client made an error, and 5xx means the server failed to handle a valid request. Each code also has a reason phrase such as Not Found, but clients are meant to act on the number. HTTP/2 and HTTP/3 do not send the phrase at all.

The core codes are defined in RFC 9110, HTTP Semantics, published in 2022. It replaced the older RFC 7231 family and renamed some codes: 413 is now "Content Too Large" and 422, previously a WebDAV-only code, is "Unprocessable Content" for general use. Other codes come from extension RFCs, such as 429 Too Many Requests (RFC 6585), 451 Unavailable For Legal Reasons (RFC 7725) and the WebDAV codes 207, 423 and 507 (RFC 4918).

Picking the right code matters more than it looks. Browsers, caches, search engines, load balancers, SDK retry logic and monitoring all act on the code without reading your error message. A 200 with {"error": "not found"} in the body gets cached and indexed. A 500 for a validation problem gets retried pointlessly and wakes up the on-call engineer. The right code lets every layer behave correctly.

How to use this tool

  1. Browse the list, which is grouped by class with each class's name as a heading. Every card shows the code, its reason phrase, a plain-language explanation and the specification that defines it.
  2. Type in the search box to filter. A number matches codes that start with it, so 5 shows all server errors and 40 shows 400 to 410. Words match the name, the explanation or the class name, so timeout, cache or redirect work.
  3. Use the All, 1xx, 2xx, 3xx, 4xx and 5xx buttons to restrict the list to one class. The count next to them shows how many codes match.
  4. Link to a code directly with a hash in the URL, such as …/http-status-codes/#429. The page opens with that code already searched.

Examples

Searching the list

Search        Result
40            400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410
timeout       408 Request Timeout, 504 Gateway Timeout
rate limit    429 Too Many Requests
nginx         502 Bad Gateway

408 and 504 are both timeouts but mean opposite things: 408 says the client was too slow sending its request; 504 says a proxy gave up waiting for the upstream server.

Conditional request returning 304

A client that cached a response with an ETag sends it back on the next request:

GET /api/products/42 HTTP/1.1
Host: shop.example
If-None-Match: "v7-3f2a"

If the resource has not changed, the server replies with no body:

HTTP/1.1 304 Not Modified
ETag: "v7-3f2a"
Cache-Control: max-age=60

The client reuses its cached copy, saving the transfer.

Rate limiting with 429

HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json

{"error": "rate_limited", "message": "Limit of 100 requests per minute exceeded"}

Retry-After is either a number of seconds, as here, or an HTTP date. Well-behaved clients wait at least that long before retrying.

Common errors and how to fix them

  • 401 when you mean 403. 401 means "we do not know who you are": the credentials are missing or invalid, and logging in may help. 403 means "we know who you are, and you may not do this". Return 401 with a WWW-Authenticate header for bad tokens, and 403 for permission failures.
  • 200 with an error body. Clients, caches and monitoring see success. Return a 4xx or 5xx status code and put the details in the body.
  • 400 versus 422. Use 400 when the request cannot be parsed (malformed JSON, wrong types) and 422 when it parses but fails validation rules (an invalid email, an end date before the start date). Many APIs use 400 for both; the key is to be consistent.
  • 302 for a permanent move. Search engines treat 302 as temporary and keep the old URL. Use 301, or 308 when the method and body must be preserved, for permanent moves.
  • POST becoming GET after a redirect. Clients may change POST to GET when following 301 or 302. Use 307 or 308 if the request must be repeated as a POST.
  • 500 for every failure. Reserve 500 for unexpected bugs. Use 503 with Retry-After for planned maintenance or overload, and 4xx codes for problems with the request.
  • 502 or 504 that the app never logged. These come from a proxy or load balancer, not the application. Check whether the upstream service was down (502) or too slow for the proxy's timeout (504).

When developers use this

  • Choosing status codes while designing a REST API, for example 201 with a Location header after a create, 204 after a delete, and 409 for a duplicate.
  • Diagnosing an unfamiliar code from a third-party API, a CDN or a browser network tab.
  • Reviewing redirect rules during a site migration to make sure permanent moves use 301 or 308.
  • Deciding which responses a client should retry: usually 408, 429, 502, 503 and 504, with backoff, but not most other 4xx codes.
  • Writing alerting rules that separate client errors from server errors.

Privacy and how it works

The list of codes is part of the page, and searching filters it in your browser. Nothing you type is sent anywhere, and no requests are made to check status codes on other sites.

Limitations

  • The list covers the codes registered with IANA and in common use: 61 in total. Retired or unused codes such as 305 Use Proxy and 306 are left out.
  • Vendor-specific codes are not included. Examples are nginx's 499 (client closed the request) and Cloudflare's 520-527 range, which you will see in logs but which are not part of any HTTP standard.
  • Explanations describe the standard meaning. Individual APIs sometimes use codes differently, so check their documentation.

FAQ

What is the difference between 401 and 403?

401 Unauthorized means the request has no valid authentication; sending correct credentials may succeed. 403 Forbidden means the server identified you and refuses anyway, so retrying with the same credentials will not help.

Should I return 404 or 403 for a resource the user cannot see?

If revealing that the resource exists would leak information, such as another customer's order ID, return 404. GitHub does this for private repositories. Otherwise 403 gives a clearer message to legitimate users.

When should I use 201 instead of 200?

Use 201 Created when a request creates a new resource, typically a POST, and include a Location header with its URL. Use 200 when the request succeeded without creating anything, or 204 when there is nothing to return.

What is the difference between 301 and 308?

Both are permanent redirects. With 301, clients may switch a POST to GET when following the redirect; with 308 they must repeat the original method and body. For ordinary page moves, 301 is fine; for API endpoints that receive POSTs, use 308.

Is 418 I'm a teapot a real status code?

It comes from an April Fools' RFC (RFC 2324) about controlling coffee pots and was never part of HTTP itself. It is reserved so that nothing else reuses the number, and some servers return it as a joke or to turn away suspected bots.

Which status codes should a client retry?

Retry 408, 429, 502, 503 and 504 after a delay, respecting any Retry-After header and backing off between attempts. Do not retry other 4xx errors unchanged, and only retry non-idempotent requests like POST if the API supports idempotency keys.

Why does my browser show a status code my server never sent?

A proxy, CDN, load balancer or browser extension in between may have generated it. Codes such as 502, 504 and vendor-specific ones like Cloudflare's 52x are produced by intermediaries, so check their logs as well as your application's.

Guides