Skip to content
Tools

HTTP Status Codes

Look up HTTP status codes quickly with meanings, descriptions, categories and common use cases. Search and browse 1xx, 2xx, 3xx, 4xx and 5xx HTTP response codes.

72 status codes

Search for an HTTP status code or select a category to explore the reference.

Pick any code from the list to see its meaning, common uses and related codes.

Most common codes

Select a status code to see its detail.

Everything runs locally in your browser. Your searches are not uploaded to our server, never stored, and never sent to any analytics endpoint. The whole status code dataset ships with the page, so search keeps working offline.

What are HTTP status codes?

An HTTP status code is a three-digit number the server sends back with every response, saying what happened to the request. It is the first thing in the response, before any headers or body, and it is what a client acts on.

The first digit gives the class — the general kind of outcome — and the remaining two identify the specific condition. That split matters more than it looks: a client that meets a code it has never seen is required to handle it according to its class. A browser receiving an unrecognised 4xx knows the request was faulty even if it has no idea what the specific number means, which is what allows new codes to be added without breaking existing clients.

The codes are defined by RFC 9110, published in June 2022, which is the current core HTTP specification and obsoletes the older RFC 2616 and RFC 7230–7235. Codes outside the core — 429 Too Many Requests, for instance — come from their own RFCs, and every registered code is listed in the IANA HTTP Status Code Registry. This tool cites the specification for each code so you can check any of it.

The short text beside the number — the reason phrase — is advisory only. Clients act on the number, are free to ignore the phrase, and HTTP/2 drops it entirely. Never write code that branches on the wording.

The five HTTP status code classes

Every status code falls into exactly one of five classes.

1xx1xx Informational4 registered codes

The request was received and understood, and processing is continuing. An interim response — the final status still follows.

100 · 101 · 102 · 103

2xx2xx Success10 registered codes

The request was successfully received, understood and accepted.

200 · 201 · 202 · 203 · 204 · 205 · 206 · 207 · +2 more

3xx3xx Redirection9 registered codes

Further action is needed to complete the request — usually following a new location, or using a cached copy.

300 · 301 · 302 · 303 · 304 · 305 · 306 · 307 · +1 more

4xx4xx Client Error29 registered codes

The request cannot be fulfilled because of something on the client side — bad syntax, missing authentication, or a resource that is not there.

400 · 401 · 402 · 403 · 404 · 405 · 406 · 407 · +21 more

5xx5xx Server Error11 registered codes

The server failed to fulfil a request that appears to be valid. The fault is on the server side.

500 · 501 · 502 · 503 · 504 · 505 · 506 · 507 · +3 more

Most common HTTP status codes

A handful of codes account for nearly everything you will see in day-to-day web and API work. Learning these well is worth more than memorising the full list.

The most frequently encountered HTTP status codes, with their class and meaning.
CodeNameClassMeaning
200OK2xxThe request succeeded. What the body contains depends on the method — the requested representation for GET, the result of the action for POST.
201Created2xxThe request succeeded and one or more new resources were created. The Location header should carry the URL of the new resource.
204No Content2xxThe request succeeded and there is deliberately no body to return. The response must not include one.
301Moved Permanently3xxThe resource has a new permanent URL, given in the Location header. Clients and search engines should update their references.
302Found3xxThe resource is temporarily at a different URL. The original URL should continue to be used for future requests.
304Not Modified3xxThe cached copy is still current, so no body is sent. Returned when a conditional request's precondition is met.
400Bad Request4xxThe server will not process the request because it is malformed — bad syntax, an invalid message frame, or deceptive routing.
401Unauthorized4xxThe request lacks valid authentication credentials. The response must include a WWW-Authenticate header describing how to authenticate.
403Forbidden4xxThe server understood the request and refuses to authorise it. Authenticating differently will not help.
404Not Found4xxThe server did not find a current representation for the target resource, and will not say whether the absence is temporary or permanent.
405Method Not Allowed4xxThe method is known but not supported for this resource. The response must include an Allow header listing the methods that are.
409Conflict4xxThe request conflicts with the current state of the resource, in a way the client could potentially resolve and retry.
422Unprocessable Content4xxThe syntax is correct and the content type is understood, but the server cannot process the instructions it contains.
429Too Many Requests4xxThe client has sent too many requests in a given period. A Retry-After header should say when to try again.
500Internal Server Error5xxThe server hit an unexpected condition and cannot be more specific. The catch-all server error.
502Bad Gateway5xxA server acting as a gateway or proxy received an invalid response from the upstream server it needed to reach.
503Service Unavailable5xxThe server cannot handle the request right now, usually because it is overloaded or down for maintenance. The condition is expected to be temporary.
504Gateway Timeout5xxA gateway or proxy did not get a response from the upstream server within the time it was prepared to wait.

HTTP status codes for APIs

APIs use status codes to communicate outcome before a client parses a single byte of the body. The groupings below are conventions rather than requirements — the specification defines what each code means, not which one your endpoint must return in a given situation.

Successful API requests

Which success code to use depends on what the endpoint did and whether there is anything to return.

200OK
The request succeeded. What the body contains depends on the method — the requested representation for GET, the result of the action for POST.
201Created
The request succeeded and one or more new resources were created. The Location header should carry the URL of the new resource.
202Accepted
The request was accepted but has not been acted on yet. Deliberately non-committal: the work may still fail, and there is no guarantee it will be completed.
204No Content
The request succeeded and there is deliberately no body to return. The response must not include one.

Client errors

The request reached the server and was understood well enough to be rejected. The client can usually fix these.

400Bad Request
The server will not process the request because it is malformed — bad syntax, an invalid message frame, or deceptive routing.
401Unauthorized
The request lacks valid authentication credentials. The response must include a WWW-Authenticate header describing how to authenticate.
403Forbidden
The server understood the request and refuses to authorise it. Authenticating differently will not help.
404Not Found
The server did not find a current representation for the target resource, and will not say whether the absence is temporary or permanent.
405Method Not Allowed
The method is known but not supported for this resource. The response must include an Allow header listing the methods that are.
409Conflict
The request conflicts with the current state of the resource, in a way the client could potentially resolve and retry.
415Unsupported Media Type
The body is in a format the server does not support for this resource and method.
422Unprocessable Content
The syntax is correct and the content type is understood, but the server cannot process the instructions it contains.
429Too Many Requests
The client has sent too many requests in a given period. A Retry-After header should say when to try again.

Server and infrastructure errors

Something failed on the server side. The client did nothing wrong and retrying may or may not help.

500Internal Server Error
The server hit an unexpected condition and cannot be more specific. The catch-all server error.
502Bad Gateway
A server acting as a gateway or proxy received an invalid response from the upstream server it needed to reach.
503Service Unavailable
The server cannot handle the request right now, usually because it is overloaded or down for maintenance. The condition is expected to be temporary.
504Gateway Timeout
A gateway or proxy did not get a response from the upstream server within the time it was prepared to wait.

Exact behaviour varies by application design, and reasonable APIs disagree. Some return 200 with an error object in the body; others use 422 for every validation failure; others use 400 throughout. None of those is wrong. What causes real pain is inconsistency within one API, because clients then have to special-case each endpoint.

HTTP error codes

“Error code” usually means a 4xx or a 5xx. The distinction between them is where the fault lies, and it is the first thing to establish when debugging:

  • 4xx — the request was faulty. Bad syntax, missing authentication, a resource that is not there, a method that is not allowed. Changing the request may fix it.
  • 5xx — the server failed. The request looked fine and the server could not fulfil it. Changing the request usually will not help.

3xx responses are not errors. They are redirections and cache responses, and describing every non-2xx response as a server error — a habit that shows up in monitoring dashboards and incident reports alike — hides the actual problem. A spike in 304s is a cache working correctly. A spike in 404s is usually a broken link, not an outage. Only 5xx rates say the server is unwell.

1xx responses are not errors either. They are interim — a final response still follows, and most client libraries handle them invisibly.

401 vs 403

The most commonly confused pair in HTTP, largely because 401 is badly named.

401Unauthorized

The request lacks valid authentication credentials. The response must include a WWW-Authenticate header describing how to authenticate.

Who are you? The server does not know. Credentials are missing, expired or invalid — and supplying valid ones may well fix it.

403Forbidden

The server understood the request and refuses to authorise it. Authenticating differently will not help.

I know who you are, and no. Re-authenticating will not help, because identity was never the problem.

The word “Unauthorized” in 401 is misleading: it means unauthenticated. It is about who you are, not what you are permitted to do. A conformant 401 must include a WWW-Authenticate header telling the client how to authenticate — if your API returns 401 without one, it is not quite following the specification. When the credential is a bearer token, a JWT decoder will show whether its exp had simply passed.

There is a third option worth knowing. A server may deliberately return 404 Not Found instead of 403, so that an unauthorised client cannot even confirm the resource exists. Returning 403 tells the requester that something is there — occasionally that itself is the leak.

400 vs 422

400Bad Request

The server will not process the request because it is malformed — bad syntax, an invalid message frame, or deceptive routing.

The server could not make sense of the request itself — broken JSON, an invalid frame, a malformed parameter.

422Unprocessable Content

The syntax is correct and the content type is understood, but the server cannot process the instructions it contains.

The request parsed cleanly and the server understood every field. It just cannot act on what they say.

The dividing line is syntax against semantics. A request body that is not valid JSON is a 400 — the server never got as far as your fields. A request body that is perfectly valid JSON with an email address in the wrong format is a 422: it parsed, it was understood, and the application rejected it.

Conventions vary and both are defensible. Many frameworks return 422 for every validation failure; many others use 400 throughout and never emit a 422 at all. No specification requires either. RFC 9110 moved 422 into core HTTP — it originated in WebDAV, where it was called Unprocessable Entity, and a great deal of tooling still uses that name.

404 vs 410

404Not Found

The server did not find a current representation for the target resource, and will not say whether the absence is temporary or permanent.

Nothing here right now. The server declines to say whether there ever was, or whether there will be again.

410Gone

The resource was deliberately removed and the condition is expected to be permanent. Stronger and more specific than 404.

It was here, we removed it on purpose, and it is not coming back. A deliberate, permanent statement.

410 is the stronger and more specific signal, and search engines act on it — a 410 URL is dropped from an index faster than a 404, which they may keep re-checking for some time.

Use 410 only when the removal really is intentional and permanent. If there is any chance the resource returns, or you simply do not know, 404 is the safer answer: it commits to nothing, which is exactly what it is for.

500 vs 502 vs 503 vs 504

Four ways for a server to fail, and knowing which one you have narrows the search considerably — three of these come from a proxy in front of your application rather than from the application itself.

500Internal Server Error

The server hit an unexpected condition and cannot be more specific. The catch-all server error.

Your application ran and threw. The proxy is fine; look in the application logs.

502Bad Gateway

A server acting as a gateway or proxy received an invalid response from the upstream server it needed to reach.

The proxy reached upstream and got something it could not use — or nothing at all. Usually the app server is down or crashed.

503Service Unavailable

The server cannot handle the request right now, usually because it is overloaded or down for maintenance. The condition is expected to be temporary.

The server is up and deliberately declining — overloaded, draining, or in maintenance. Should carry Retry-After.

504Gateway Timeout

A gateway or proxy did not get a response from the upstream server within the time it was prepared to wait.

Upstream is reachable but too slow. It may still be working on the request; the proxy stopped waiting.

A quick way to hold them apart: 500 is broken (your code threw), 502 is broken further down (the thing behind the proxy is not answering properly), 503 is unavailable (deliberately declining), and 504 is too slow (a timeout).

For DevOps work the distinction is diagnostic. A 500 sends you to application logs. A 502 sends you to whether the process is running at all. A 504 sends you to timeouts and slow queries. A 503 is often the system telling you it is doing the right thing under load.

301 vs 302 vs 307 vs 308

Two questions separate these four: is the move permanent, and is the request method preserved?

The four redirect status codes compared by permanence and method preservation.
CodeNamePermanent?Method preserved?
301Moved PermanentlyYesNot guaranteed
302FoundNoNot guaranteed
307Temporary RedirectNoYes
308Permanent RedirectYesYes

“Not guaranteed” is doing real work in that table. The specification does not permit a client to change the method when following a 301 or 302 — but in practice clients have done so for decades, turning a POST into a GET, and the behaviour is now so entrenched that the specification acknowledges it. That is precisely why 307 and 308 exist: same permanence semantics, but the method is guaranteed to survive.

In practice: for a plain page move, 301 is fine and universally understood. For anything where a POST must stay a POST — an API endpoint, a form target — use 308 for permanent and 307 for temporary. And where you want a POST to be followed by a GET on purpose, that is 303 See Other, the standard post/redirect/get pattern that stops a refresh resubmitting a form.

Best practices for APIs

  • Be consistent within your own API. This matters more than any individual choice. Clients can adapt to an API that always uses 400 for validation; they cannot adapt to one that uses 400 on some endpoints and 422 on others.
  • Use the class correctly even when the specific code is arguable. Returning 200 with {"error": ...} in the body breaks every client, proxy and monitoring tool that reads the status line — which is all of them.
  • Put the detail in the body. A status code carries no specifics. Say which field failed and why. RFC 9457 defines a standard problem details format if you would rather not invent one.
  • Send Retry-After with 503 and 429. Without it, clients guess, and guessing under load means retry storms.
  • Send Allow with 405 and WWW-Authenticate with 401. Both are required, both are routinely omitted, and both turn a dead end into something a client can act on.
  • Do not invent codes.A number outside the IANA registry means nothing to anyone else’s tooling. If nothing fits, use the closest standard code and explain in the body.
  • Reserve 5xx for genuine server faults. Returning 500 for a validation error makes your error rate meaningless and will page somebody at three in the morning for a mistyped email address.

None of this is imposed by the HTTP specification beyond what is stated as required. Framework conventions — Rails preferring 422, some REST guides insisting on 201 for every creation — are conventions, not requirements, and it is worth knowing which is which before adopting a rule.

When you are debugging a response, the JSON formatter will make the body readable, and the MIME type lookup covers the Content-Type that came with it.

Full HTTP status code reference

Every code in the dataset, in numeric order. The tool at the top of the page searches and filters the same records. Codes that are deprecated, reserved or not part of HTTP at all are labelled as such.

Complete reference of HTTP status codes with code, name, class and description.
CodeNameClassDescription
100Continue1xxThe initial part of the request was received and the client should continue sending the body. Sent in response to an Expect: 100-continue header.
101Switching Protocols1xxThe server is switching to the protocol the client asked for in the Upgrade header, and will do so once this response is sent.
102ProcessingWebDAV1xxThe server has accepted the request but has not finished it. An interim response used to stop a client timing out during a long WebDAV operation.
103Early HintsExtension RFC1xxAn interim response carrying Link headers so the client can start preloading resources while the server prepares the final response.
200OK2xxThe request succeeded. What the body contains depends on the method — the requested representation for GET, the result of the action for POST.
201Created2xxThe request succeeded and one or more new resources were created. The Location header should carry the URL of the new resource.
202Accepted2xxThe request was accepted but has not been acted on yet. Deliberately non-committal: the work may still fail, and there is no guarantee it will be completed.
203Non-Authoritative Information2xxThe request succeeded, but the payload was modified in transit by a proxy and differs from what the origin server sent.
204No Content2xxThe request succeeded and there is deliberately no body to return. The response must not include one.
205Reset Content2xxThe request succeeded and the client should reset the document view that caused it — clearing a form, for example.
206Partial Content2xxThe server is returning part of the resource, as requested by a Range header.
207Multi-StatusWebDAV2xxCarries several independent status codes in one XML body, for a request that acted on multiple resources.
208Already ReportedWebDAV2xxInside a Multi-Status response, marks a resource whose members were already enumerated earlier in the same reply, to avoid repeating them.
226IM UsedExtension RFC2xxThe server fulfilled the request and the response represents one or more instance manipulations applied to the current resource.
300Multiple Choices3xxThe request has more than one possible response and the client, or its user, needs to pick one. There is no standard way to present the choices.
301Moved Permanently3xxThe resource has a new permanent URL, given in the Location header. Clients and search engines should update their references.
302Foundformerly Moved Temporarily3xxThe resource is temporarily at a different URL. The original URL should continue to be used for future requests.
303See Other3xxThe response to the request is at another URL and should be retrieved with GET, whatever method was originally used.
304Not Modified3xxThe cached copy is still current, so no body is sent. Returned when a conditional request's precondition is met.
305Use ProxyDeprecated3xxDefined to tell a client to reach the resource through a proxy. Deprecated for security reasons and must not be generated.
306(Unused)formerly Switch ProxyReserved, unused3xxReserved. Used in an early draft of the specification and never standardised, so the number is permanently set aside.
307Temporary Redirect3xxThe resource is temporarily elsewhere, and the client must not change the request method when following the redirect.
308Permanent Redirect3xxThe resource has moved permanently, and the client must not change the request method when following the redirect.
400Bad Request4xxThe server will not process the request because it is malformed — bad syntax, an invalid message frame, or deceptive routing.
401Unauthorized4xxThe request lacks valid authentication credentials. The response must include a WWW-Authenticate header describing how to authenticate.
402Payment Required4xxReserved for future use. No standard meaning has ever been defined, though some APIs use it for billing and quota problems.
403Forbidden4xxThe server understood the request and refuses to authorise it. Authenticating differently will not help.
404Not Found4xxThe server did not find a current representation for the target resource, and will not say whether the absence is temporary or permanent.
405Method Not Allowed4xxThe method is known but not supported for this resource. The response must include an Allow header listing the methods that are.
406Not Acceptable4xxThe server cannot produce a response matching the client's Accept headers for content type, language or encoding.
407Proxy Authentication Required4xxLike 401, but the authentication is required by a proxy rather than the origin server. Must include a Proxy-Authenticate header.
408Request Timeout4xxThe server closed an idle connection because the client did not produce a request in time.
409Conflict4xxThe request conflicts with the current state of the resource, in a way the client could potentially resolve and retry.
410Gone4xxThe resource was deliberately removed and the condition is expected to be permanent. Stronger and more specific than 404.
411Length Required4xxThe server refuses the request because it has no Content-Length header.
412Precondition Failed4xxA precondition in the request headers evaluated to false on the server — the resource is not in the state the client expected.
413Content Too Largeformerly Payload Too Large, Request Entity Too Large4xxThe request body is larger than the server is willing or able to process.
414URI Too Longformerly Request-URI Too Long4xxThe request target is longer than the server is willing to interpret.
415Unsupported Media Type4xxThe body is in a format the server does not support for this resource and method.
416Range Not Satisfiableformerly Requested Range Not Satisfiable4xxNone of the ranges in the request's Range header can be satisfied — typically a start position beyond the end of the resource.
417Expectation Failed4xxThe expectation in the request's Expect header cannot be met by the server.
418I'm a TeapotExtension RFCNot a real status4xxFrom a 1998 April Fools' specification for brewing coffee. Reserved in the IANA registry so nothing else can claim the number, and never a real HTTP status.
419Page ExpiredNon-standard4xxNot an HTTP status code. Used by the Laravel framework when a CSRF token is missing or has expired.
421Misdirected Request4xxThe request reached a server that is not configured to produce a response for the requested scheme and authority.
422Unprocessable Contentformerly Unprocessable Entity4xxThe syntax is correct and the content type is understood, but the server cannot process the instructions it contains.
423LockedWebDAV4xxThe target resource is locked and cannot be modified.
424Failed DependencyWebDAV4xxThe request failed because an earlier request it depended on failed.
425Too EarlyExtension RFC4xxThe server is unwilling to process a request sent in TLS early data, because it could be replayed by an attacker.
426Upgrade Required4xxThe server refuses to use the current protocol and requires an upgrade. Must include an Upgrade header naming the required protocol.
428Precondition RequiredExtension RFC4xxThe server requires the request to be conditional, to stop a client overwriting changes it has not seen.
429Too Many RequestsExtension RFC4xxThe client has sent too many requests in a given period. A Retry-After header should say when to try again.
431Request Header Fields Too LargeExtension RFC4xxThe server refuses the request because its header fields are too large, either individually or in total.
451Unavailable For Legal ReasonsExtension RFC4xxThe resource is unavailable because of a legal demand — a court order, statutory censorship or a takedown notice.
499Client Closed RequestNon-standard4xxNot an HTTP status code. Logged by nginx when the client disconnects before the server has sent a response.
500Internal Server Error5xxThe server hit an unexpected condition and cannot be more specific. The catch-all server error.
501Not Implemented5xxThe server does not support the functionality needed — specifically, it does not recognise the request method at all.
502Bad Gateway5xxA server acting as a gateway or proxy received an invalid response from the upstream server it needed to reach.
503Service Unavailable5xxThe server cannot handle the request right now, usually because it is overloaded or down for maintenance. The condition is expected to be temporary.
504Gateway Timeout5xxA gateway or proxy did not get a response from the upstream server within the time it was prepared to wait.
505HTTP Version Not Supported5xxThe server does not support the major HTTP version used in the request.
506Variant Also NegotiatesExtension RFC5xxA content negotiation misconfiguration: the chosen variant is itself set up to negotiate, creating a circular reference.
507Insufficient StorageWebDAV5xxThe server cannot store the representation needed to complete the request.
508Loop DetectedWebDAV5xxThe server stopped an operation because it found an infinite loop while processing the request.
510Not ExtendedExtension RFCObsoleted5xxDefined so a server could say a request needed further extensions. The experiment it came from was retired and the code is obsolete.
511Network Authentication RequiredExtension RFC5xxThe client must authenticate to get network access — generated by an intercepting proxy rather than the origin server.
520Web Server Returned an Unknown ErrorNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the origin server returned something empty, unexpected or malformed.
521Web Server Is DownNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the origin server refused the connection.
522Connection Timed OutNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the TCP handshake with the origin server did not complete in time.
523Origin Is UnreachableNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the origin server could not be reached at all, often a DNS or routing problem.
524A Timeout OccurredNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the connection to the origin succeeded but no response arrived within the time limit.
525SSL Handshake FailedNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the TLS handshake with the origin server failed.
526Invalid SSL CertificateNon-standard5xxNot an HTTP status code. A Cloudflare error meaning the origin server's TLS certificate could not be validated.

Frequently asked questions

What are HTTP status codes?

HTTP status codes are three-digit numbers a server sends back with every response to say what happened to the request. The first digit gives the class — 1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error — and the remaining two identify the specific condition. They are defined by RFC 9110 and registered with IANA, so the same code means the same thing across every server and client that implements HTTP.

What are the five HTTP status code classes?

1xx Informational means the request was received and processing continues, with a final response still to come. 2xx Success means the request was received, understood and accepted. 3xx Redirection means further action is needed, usually following a new location or using a cached copy. 4xx Client Error means the request is faulty. 5xx Server Error means the server failed to fulfil an apparently valid request.

What does HTTP 200 mean?

200 OK means the request succeeded. What the body contains depends on the method: for a GET it is the requested representation, for a POST it is the result of the action. It is the most common response on the web and the default for any successful request that has something to return.

What does HTTP 201 mean?

201 Created means the request succeeded and one or more new resources were created as a result. The response should carry a Location header pointing at the new resource. It is the conventional reply to a POST that creates a record, though returning 200 with the created object is also common and equally valid.

What does HTTP 204 mean?

204 No Content means the request succeeded and there is deliberately nothing to send back. The response must not include a body. It is typical for a successful DELETE, or for a PUT or PATCH where the client already knows the resulting state and does not need it echoed.

What does HTTP 301 mean?

301 Moved Permanently means the resource has a new permanent URL, given in the Location header. Clients should update bookmarks and search engines should transfer ranking signals to the new address. Be aware that clients have historically changed a POST to a GET when following a 301 — use 308 Permanent Redirect when the method must be preserved.

What does HTTP 302 mean?

302 Found means the resource is temporarily somewhere else and the original URL should continue to be used for future requests. Like 301, most clients change POST to GET when following it, which is why 303 See Other and 307 Temporary Redirect exist — they make the intended behaviour explicit instead of relying on convention.

What does HTTP 400 mean?

400 Bad Request means the server will not process the request because something about it is malformed — broken syntax, an invalid message frame, or a body it could not parse. It is widely used as a general-purpose client error. When the syntax is fine but the content breaks the application's rules, 422 Unprocessable Content is more precise.

What does HTTP 401 mean?

401 Unauthorized means the request lacks valid authentication credentials. The name is misleading: it is about authentication, not permission. A 401 response must include a WWW-Authenticate header telling the client how to authenticate. Common causes are a missing API token, an expired session, or an invalid login.

What does HTTP 403 mean?

403 Forbidden means the server understood the request and refuses to authorise it. Unlike a 401, authenticating differently will not help — the client is known and still not allowed. Servers sometimes return 404 Not Found instead, to avoid confirming that a resource exists to someone not permitted to see it.

What does HTTP 404 mean?

404 Not Found means the server has no current representation for the requested resource, and deliberately declines to say whether that is temporary or permanent. It covers mistyped URLs, deleted pages, missing API resources, and cases where a server is hiding a resource's existence from an unauthorised client.

What does HTTP 405 mean?

405 Method Not Allowed means the server recognises the method but does not support it for this particular resource — a POST to a read-only endpoint, for example. The response must include an Allow header listing the methods that are supported, which makes it one of the more actionable errors to receive.

What does HTTP 409 mean?

409 Conflict means the request clashes with the current state of the resource, in a way the client could potentially resolve and retry. Typical cases are creating a record that already exists, a duplicate value in a unique field, or two clients editing the same resource concurrently.

What does HTTP 422 mean?

422 Unprocessable Content means the request was syntactically valid and the content type was understood, but the server cannot process the instructions inside it — most often a validation failure on a well-formed body. RFC 9110 moved it into core HTTP from WebDAV, where it was called Unprocessable Entity, and many libraries still use the old name.

What does HTTP 429 mean?

429 Too Many Requests means the client has sent too many requests in a given period and is being rate limited. A well-behaved server includes a Retry-After header saying when to try again. It is defined by RFC 6585 rather than the core specification, and is the standard response for API throttling.

What does HTTP 500 mean?

500 Internal Server Error means the server hit an unexpected condition and has nothing more specific to say. It is the catch-all server error, most often an unhandled exception. It tells you the fault is on the server side and nothing else — the detail will be in the server's logs, not the response.

What does HTTP 502 mean?

502 Bad Gateway means a server acting as a gateway or proxy received an invalid response from the upstream server behind it. In practice it usually means the application server crashed, is not running, or returned something the proxy could not parse. The proxy is working; what is behind it is not.

What does HTTP 503 mean?

503 Service Unavailable means the server cannot handle the request right now, typically because it is overloaded or down for maintenance, and the condition is expected to be temporary. It should carry a Retry-After header when the duration is known. Unlike 502, it is usually the server deliberately declining rather than failing.

What does HTTP 504 mean?

504 Gateway Timeout means a gateway or proxy did not receive a response from the upstream server within the time it was willing to wait. The upstream may still be working on it — the proxy simply gave up. Common causes are slow database queries and requests that exceed a load balancer's timeout.

What is the difference between 401 and 403?

401 Unauthorized means the server does not know who you are — credentials are missing, expired or invalid, and supplying valid ones may fix it. 403 Forbidden means the server knows who you are and you still may not do this; re-authenticating will not help. The rule of thumb: 401 is about identity, 403 is about permission.

What is the difference between 404 and 410?

404 Not Found says the resource cannot currently be found, without committing to whether it ever existed or might return. 410 Gone says it was deliberately removed and is not expected to come back. 410 is a stronger signal — search engines drop 410 URLs from their indexes faster. Use 410 only when the removal is intentional and permanent; otherwise 404 is the safer answer.

What is the difference between 502, 503 and 504?

All three come from a gateway or proxy in front of your application. 502 Bad Gateway means the upstream returned something invalid or refused the connection. 503 Service Unavailable means the server itself is unable to handle the request, usually through overload or maintenance. 504 Gateway Timeout means the upstream was reachable but did not answer in time. Roughly: 502 is broken, 503 is unavailable, 504 is too slow.

Which HTTP status code should an API return after creating a resource?

201 Created is the conventional answer, with a Location header pointing at the new resource. That said, no specification requires it — plenty of well-designed APIs return 200 OK with the created object, or 202 Accepted when creation is queued rather than immediate. What matters most is choosing one and applying it consistently across the API.

Is 404 a client error?

Yes, by classification. 4xx codes indicate the request cannot be fulfilled because of an apparent client-side problem, and a request for something that is not there qualifies. In practice the cause is often a stale link or a server-side deletion rather than any mistake by the person making the request — the class describes where the problem appears, not who is at fault.

Are HTTP status codes standardized?

Yes. Core HTTP status codes are defined by RFC 9110, with others in extension RFCs such as RFC 6585 for 428, 429 and 431, and RFC 4918 for the WebDAV codes. All registered codes are listed in the IANA HTTP Status Code Registry. Codes such as nginx's 499 or Cloudflare's 520 to 526 are not registered and are conventions of those specific products.

Popular tools

↑ ↓NavigateOpenEscClose