The server has received the request headers, and the client should send the request body. Used with an Expect: 100-continue header.
HTTP status code lookup
Look up what every HTTP status code means.
70 status codes
1xx Informational
The request was received and the process is continuing.
The server agrees to switch to the protocol the client asked for in the Upgrade header, for example from HTTP to WebSocket.
WebDAV: the server has accepted the request but hasn't finished it yet. Now deprecated.
Sent before the final response so the browser can start preloading resources listed in Link headers.
2xx Success
The request was received, understood and accepted.
The request succeeded. The body contains the result, such as the page or the requested data.
The request succeeded and created a new resource. The Location header usually points to it.
What to check: Typical response to a successful POST that creates something.
The request was accepted for processing, but the work hasn't finished. Common for queued or background jobs.
The response succeeded but was modified by a transforming proxy, so it isn't exactly what the origin server sent.
The request succeeded and there is no body to return. Common for DELETE requests and saved settings.
What to check: A 204 must not include a body; clients shouldn't try to parse one.
The request succeeded and the client should reset the document view, such as clearing a form.
The server is sending only part of the resource, as asked for with a Range header. Used for resumable downloads and video streaming.
WebDAV: the body contains separate status codes for several operations.
WebDAV: members of a collection were already listed earlier in the same response.
The server fulfilled the request and the response is the result of instance manipulations, such as a delta.
3xx Redirection
Further action is needed to complete the request, usually following a new URL.
The resource has several representations and the client or user should choose one.
The resource has a new permanent URL, given in the Location header. Browsers and search engines update to the new URL.
What to check: Use for permanent moves, such as http to https or an old page to a new one. Clients may change a POST to GET when following it; use 308 if the method must stay the same.
The resource is temporarily at a different URL. Future requests should still use the original URL.
What to check: Clients may change POST to GET when following a 302. Use 307 to keep the method.
The client should get the result from another URL with a GET request. Often used after a form submission to avoid resubmitting.
The cached version is still valid, so the server sends no body. Used with If-None-Match or If-Modified-Since.
What to check: A normal part of caching, not an error.
Deprecated. Told the client to use a proxy; browsers ignore it for security reasons.
The resource is temporarily at another URL, and the client must repeat the request with the same method and body.
The resource has permanently moved, and the client must repeat the request with the same method and body.
4xx Client error
The request has a problem, such as bad syntax, missing auth or a wrong URL.
The server can't process the request because of a client error, such as malformed syntax or invalid data.
What to check: Check the request body (for example invalid JSON), required parameters and the Content-Type header.
Authentication is required and has failed or hasn't been provided. Despite the name, it means unauthenticated.
What to check: Send valid credentials, such as an Authorization header with a current token. If the user is logged in but not allowed, the right code is 403.
Reserved for future use. Some APIs use it when a plan limit is reached or payment is needed.
The server understood the request but refuses to allow it. Logging in again won't help.
What to check: The user is identified but lacks permission, or the server blocks access (file permissions, IP rules, a firewall or bot protection).
The server can't find the requested resource. The URL may be wrong or the page may have been removed.
What to check: Check the URL for typos, confirm the route or file exists, and add a redirect if the content moved. For an API, check the resource ID.
The HTTP method isn't supported for this URL, such as POST to a read-only endpoint. The Allow header lists valid methods.
The server can't produce a response matching the Accept headers the client sent.
Like 401, but the client must first authenticate with a proxy.
The server timed out waiting for the client to finish sending the request.
The request conflicts with the current state of the resource, such as editing an outdated version or creating a duplicate.
The resource has been permanently removed and won't come back. Search engines drop it faster than a 404.
The server requires a Content-Length header, which the request didn't include.
A condition in the request headers, such as If-Match, wasn't met. Used to prevent overwriting newer changes.
The request body is larger than the server allows. Formerly called Payload Too Large.
What to check: Reduce the upload size or raise the limit, such as client_max_body_size in nginx.
The URL is longer than the server will process, often because too much data was put in the query string.
The server won't accept the request body's format.
What to check: Set the right Content-Type header, for example application/json when sending JSON.
The Range header asks for part of the file that doesn't exist, such as beyond its end.
The server can't meet the requirement in the Expect header.
An April Fools' joke from RFC 2324: a teapot refusing to brew coffee. Not used in real HTTP, though some servers return it as an easter egg.
Laravel returns it when a form's CSRF token is missing or no longer matches the session, usually because the page was open longer than the session lasts. Reload the page and submit the form again.
Twitter's old API returned it when a client was rate limited. Current APIs, including X's, use 429 Too Many Requests instead.
The request reached a server that can't produce a response for this host, often due to reused HTTP/2 connections.
The request is well formed but has semantic errors, such as failed validation. Formerly Unprocessable Entity.
What to check: Common in APIs for validation errors; the body usually explains which fields are wrong.
WebDAV: the resource is locked.
WebDAV: the request failed because an earlier request it depended on failed.
The server won't process a request that might be replayed, such as one sent in TLS early data.
The client must switch to a different protocol, named in the Upgrade header.
The server requires the request to be conditional, such as including If-Match, to avoid lost updates.
The client sent too many requests in a given time (rate limiting).
What to check: Slow down and retry after the time in the Retry-After header, if present. Use backoff and caching to send fewer requests.
The request headers are too large, often because of too many or very large cookies.
What to check: Clear cookies for the site or reduce header size.
The resource can't be provided for legal reasons, such as a court order or government block.
The client closed the connection before the server responded, for example a user cancelling or a client timeout.
5xx Server error
The server failed to handle a request that looks valid.
The server hit an unexpected condition and couldn't complete the request. A generic catch-all error.
What to check: Check the server logs for the exception or error message. Common causes are bugs, failed database queries and bad configuration.
The server doesn't support the functionality needed for the request, such as an unknown method.
A server acting as a gateway or proxy got an invalid response from the server behind it.
What to check: Usually the upstream app crashed, isn't running or returned something invalid. Check that the backend is up and the proxy points to the right address.
The server can't handle the request right now, usually because it's overloaded or down for maintenance.
What to check: Often temporary; a Retry-After header may say when to retry. Check server load, maintenance mode and health checks.
A gateway or proxy didn't get a response from the server behind it in time.
What to check: The backend is too slow or unreachable. Look for slow queries or long-running requests, or raise the proxy timeout if the work really takes long.
The server doesn't support the HTTP version used in the request.
A server configuration error in content negotiation creates a circular reference.
WebDAV: the server can't store what's needed to complete the request.
WebDAV: the server found an infinite loop while processing the request.
Further extensions to the request are required. The specification behind it is now historic.
The client must authenticate to get network access, as with Wi-Fi captive portals in hotels and airports.
The origin server returned an empty, unknown or unexpected response to Cloudflare.
Cloudflare couldn't connect because the origin server refused the connection.
Cloudflare couldn't complete a TCP connection to the origin server in time.
Cloudflare can't reach the origin server, for example because of a DNS problem.
Cloudflare connected to the origin, but it didn't send an HTTP response in time.
About the HTTP status code lookup
Every HTTP response starts with a three-digit status code that tells the client what happened: whether the request worked, was redirected, or failed because of the client or the server. Knowing what a code means is the fastest way to start debugging an API, a broken page or a redirect.
This reference lists every official status code from the IANA registry with its current name from RFC 9110, plus common unofficial codes from nginx and Cloudflare. Search by number or keyword, and see what to check for the errors you'll meet most often.
How to use the HTTP status code lookup
- Type a code such as
404, a range such as5xx, or a word such astimeoutorredirect. - Or use the category buttons to show only 1xx, 2xx, 3xx, 4xx or 5xx codes.
- Read the meaning and, for common errors, what to check.
- Use the # link next to a code to share a direct link to it.
Examples
Search by number
Input
502Output
502 Bad Gateway
A server acting as a gateway or proxy got an invalid response from the upstream server.
Common causes: the app behind nginx or a load balancer crashed, isn't listening on the expected port, or closed the connection.Search by word
Input
rateOutput
429 Too Many Requests
The client sent too many requests in a given time. Check the Retry-After header before trying again.Common errors and how to fix them
401 or 403: which one should my API return?
Return 401 when the request has no valid credentials, so logging in could help. Return 403 when the user is known but not allowed to do this.
Should a failed validation be 400 or 422?
Both are common. 400 fits malformed requests, like broken JSON; 422 fits well-formed requests whose values fail validation. Pick one and use it consistently.
Should I return 200 with an error message in the body?
No. Clients, caches and monitoring tools rely on the status code. Return a 4xx or 5xx code and put the details in the body.
Good to know
- The first digit gives the class: 1xx informational, 2xx success, 3xx redirection, 4xx client error and 5xx server error.
- 4xx errors mean the request needs to change, such as a wrong URL, missing login or invalid data. 5xx errors mean the server failed, so the same request may work later.
- Codes marked Unofficial come from a specific product, such as nginx (499) or Cloudflare (520–524), and aren't part of the HTTP standard.
- Some codes were renamed in RFC 9110: 413 is now Content Too Large and 422 is Unprocessable Content. Older tools may still show the previous names.
Frequently asked questions
What is the difference between 401 and 403?
401 Unauthorized means the request has no valid authentication, so logging in may fix it. 403 Forbidden means the server knows who you are but you don't have permission, so logging in again won't help.
Should I use 301 or 302 for a redirect?
Use 301 (or 308) when a page has moved permanently, so browsers and search engines update to the new URL. Use 302 (or 307) for temporary redirects. 307 and 308 also guarantee the request method doesn't change.
What is the difference between 502, 503 and 504?
All three come from a server or proxy in front of your app. 502 means it got an invalid response from the backend, 503 means the service is unavailable or overloaded, and 504 means the backend didn't respond in time.