Developer Utilities

HTTP Status Codes List

A complete list of HTTP response codes from 1xx to 5xx. Search the reference, or scroll the full table below — every HTTP status code has its meaning, typical causes and a direct link (for example #404).

Loading Utility…

HTTP Status Codes List

Every standard HTTP response code from 1xx to 5xx, with what it means and when you will see it.

1xx Informational

CodeNameMeaning
100ContinueThe server has received the request headers and the client should proceed to send the request body.
101Switching ProtocolsThe requester has asked the server to switch protocols.
102ProcessingServer has received and is processing the request, but no response is available yet.
103Early HintsLets the server send preliminary response headers (usually Link preload hints) before the final response.

2xx Success

CodeNameMeaning
200OKStandard response for successful HTTP requests.
201CreatedThe request has been fulfilled and has resulted in a new resource being created.
202AcceptedThe request has been accepted for processing, but the processing has not been completed.
203Non-Authoritative InformationThe request succeeded, but the returned metadata was modified by a transforming proxy.
204No ContentThe server successfully processed the request and is not returning any content.
205Reset ContentThe request succeeded and the client should reset the document view, such as clearing a form.
206Partial ContentThe server is delivering only part of the resource due to a range header sent by the client.
207Multi-StatusConveys status for multiple independent operations in one XML body.
208Already ReportedMembers of a DAV binding were already enumerated earlier in the response.
226IM UsedThe server fulfilled a GET with instance manipulations applied to the current instance.

3xx Redirection

CodeNameMeaning
300Multiple ChoicesThe resource has several representations and the client may choose one.
301Moved PermanentlyThis and all future requests should be directed to the given URI.
302FoundThe resource was found, but at a different URI temporarily.
303See OtherThe response to the request can be found at another URI using GET.
304Not ModifiedIndicates that the resource has not been modified since the version specified by the request headers.
307Temporary RedirectThe request should be repeated with another URI; however, future requests should still use the original URI.
308Permanent RedirectThe request and all future requests should be repeated using another URI.

4xx Client Error

CodeNameMeaning
400Bad RequestThe server cannot or will not process the request due to something that is perceived to be a client error.
401UnauthorizedSimilar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.
402Payment RequiredReserved for future use; some APIs use it when a payment or quota is required.
403ForbiddenThe request was valid, but the server is refusing action. The user might not have the necessary permissions.
404Not FoundThe requested resource could not be found but may be available in the future.
405Method Not AllowedA request method is not supported for the requested resource.
406Not AcceptableThe server cannot produce a response matching the Accept headers sent by the client.
407Proxy Authentication RequiredThe client must first authenticate itself with the proxy.
408Request TimeoutThe server timed out waiting for the request.
409ConflictIndicates that the request could not be processed because of conflict in the current state of the resource.
410GoneThe resource is no longer available and will not be available again.
411Length RequiredThe request did not specify a Content-Length, which the server requires.
412Precondition FailedA precondition in the request headers (such as If-Match) evaluated to false.
413Content Too LargeThe request body is larger than the server is willing to process.
414URI Too LongThe URI provided was too long for the server to process.
415Unsupported Media TypeThe request body format is not supported by the server.
416Range Not SatisfiableThe client asked for a portion of the file the server cannot supply.
417Expectation FailedThe server cannot meet the requirements of the Expect request header.
418I'm a teapotAn April Fools joke from RFC 2324; the server refuses to brew coffee because it is a teapot.
421Misdirected RequestThe request was directed at a server that cannot produce a response for it.
422Unprocessable EntityThe request was well-formed but was unable to be followed due to semantic errors.
423LockedThe resource being accessed is locked.
424Failed DependencyThe request failed because it depended on another request that failed.
425Too EarlyThe server is unwilling to process a request that might be replayed.
426Upgrade RequiredThe client should switch to a different protocol, given in the Upgrade header.
428Precondition RequiredThe server requires the request to be conditional.
429Too Many RequestsThe user has sent too many requests in a given amount of time.
431Request Header Fields Too LargeThe server refuses the request because its header fields are too large.
451Unavailable For Legal ReasonsThe resource is unavailable due to a legal demand, such as government censorship.

5xx Server Error

CodeNameMeaning
500Internal Server ErrorA generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
501Not ImplementedThe server either does not recognize the request method, or it lacks the ability to fulfil the request.
502Bad GatewayThe server was acting as a gateway or proxy and received an invalid response from the upstream server.
503Service UnavailableThe server cannot handle the request (because it is overloaded or down for maintenance).
504Gateway TimeoutThe server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
505HTTP Version Not SupportedThe server does not support the HTTP version used in the request.
506Variant Also NegotiatesTransparent content negotiation resulted in a circular reference.
507Insufficient StorageThe server is unable to store the representation needed to complete the request.
508Loop DetectedThe server detected an infinite loop while processing the request.
510Not ExtendedFurther extensions to the request are required for the server to fulfil it.
511Network Authentication RequiredThe client needs to authenticate to gain network access.

HTTP Status Codes Guide · 10 min read

HTTP Status Codes: Complete Reference for Developers

HTTP status codes are the protocol layer's way of communicating exactly what happened to a request. Our HTTP Status Code Reference is a searchable, offline-capable directory of every RFC-standard code — with practical explanations for when and how to use each one correctly.

The Five Classes

HTTP status codes are three-digit integers grouped into five ranges by their first digit:

Range Class Meaning
1xx Informational Request received, processing continues
2xx Success Request received, understood, and accepted
3xx Redirection Further action needed to complete the request
4xx Client Error Request contains bad syntax or cannot be fulfilled
5xx Server Error Server failed to fulfil a valid request

1xx — Informational

Rarely seen in application code but important in HTTP/2 and WebSocket upgrades:

100 Continue — The server has received the request headers and the client should proceed to send the request body. Used when clients send Expect: 100-continue before uploading large payloads.

101 Switching Protocols — The server is switching to the protocol requested in the Upgrade header. This is how WebSocket connections are established — the initial HTTP handshake ends with a 101.

2xx — Success

200 OK — The standard success response. The response body contains the requested resource.

201 Created — A new resource was created. Always include a Location header pointing to the new resource. Use this for POST requests that create records.

HTTP/1.1 201 Created
Location: /api/users/456
Content-Type: application/json

202 Accepted — The request was received and will be processed asynchronously. Use this when work is queued but not yet complete (e.g., email sends, video transcoding jobs, background data exports).

204 No Content — Success, but no body. The correct response for DELETE requests and PUT operations that don't return the updated resource.

206 Partial Content — Used with Range requests for large file downloads. Streaming video players use this to download content in chunks.

3xx — Redirection

301 Moved Permanently — The resource has permanently moved to the URL in the Location header. Search engines transfer all ranking signals to the new URL. Use this for permanent URL changes during site migrations.

302 Found — Temporary redirect. Search engines keep ranking the original URL. Use this for A/B testing redirects, maintenance pages, and login redirects.

303 See Other — After a POST, redirect to a GET endpoint. The standard pattern for POST-Redirect-GET (PRG), which prevents form resubmission on browser back/refresh.

304 Not Modified — The cached version of the resource is still valid. Sent in response to conditional requests (If-None-Match, If-Modified-Since). The browser uses its cache instead of downloading again.

307 Temporary Redirect — Like 302, but the HTTP method must not change. A POST to a URL returning 307 should POST to the redirect target, not GET.

308 Permanent Redirect — Like 301, but the HTTP method must not change. Use this instead of 301 when you need to permanently redirect a POST endpoint.

SEO implication: always use 301 (or 308 for non-GET) for permanent moves. A 302 on a URL that has been "temporarily" redirected for years is a common SEO mistake — Google won't consolidate signals to the new URL.

4xx — Client Errors

400 Bad Request — Generic client error. The server couldn't understand the request due to malformed syntax. Too vague for modern APIs — prefer more specific codes.

401 Unauthorized — Authentication required (despite the name — HTTP spec uses "unauthorized" to mean "unauthenticated"). The client should authenticate and retry. Include a WWW-Authenticate header indicating the authentication scheme.

403 Forbidden — Authenticated but not authorized. The server understood the request but refuses to act on it. Don't expose which resources exist to unauthorized users — return 404 instead of 403 when resource enumeration is a concern.

404 Not Found — Resource doesn't exist. Also the correct response when you want to hide a resource from unauthorized users (as above).

405 Method Not Allowed — The HTTP method isn't allowed on this endpoint. Always include an Allow header listing valid methods. A DELETE /users when only GET and POST are supported.

409 Conflict — Request conflicts with current state. Classic use case: trying to create a user with an email that already exists.

410 Gone — Resource existed but has been permanently deleted. Different from 404 — tells crawlers to remove the URL from their index. Use this for intentionally removed content.

422 Unprocessable Entity — Syntactically valid request but semantically wrong. The right code for validation errors: required field missing, value out of range, wrong data type. Follow RFC 7807 (Problem Details) format:

{
  "type": "https://example.com/errors/validation",
  "title": "Validation Error",
  "status": 422,
  "errors": [
    { "field": "email", "message": "Invalid email format" },
    { "field": "age", "message": "Must be 18 or older" }
  ]
}

429 Too Many Requests — Rate limit exceeded. Always include Retry-After header with the number of seconds to wait. Also include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.

400 vs 401 vs 403 vs 422 — the confusion matrix:

Code Situation
400 Malformed request syntax, unparseable body
401 No valid authentication credentials provided
403 Credentials valid, but insufficient permissions
422 Request parsed, but fails business logic validation

5xx — Server Errors

500 Internal Server Error — Unhandled exception on the server. Log the full error server-side, return a generic message to the client. Never expose stack traces in production responses.

502 Bad Gateway — The server (acting as a gateway) received an invalid response from an upstream server. Common with reverse proxies (Nginx, load balancers) when your application crashes or returns garbage.

503 Service Unavailable — Server temporarily unable to handle requests — overloaded or down for maintenance. Include a Retry-After header. Used by load balancers when no healthy backend instances are available.

504 Gateway Timeout — The upstream server didn't respond in time. Common in microservice architectures when a dependency is slow. Distinguish from 503: 503 means the server refused; 504 means it didn't respond at all.

504 vs 502: Both are gateway errors. 502 means the upstream responded with garbage; 504 means it didn't respond within the timeout.

Designing Better API Error Responses

A bare status code isn't enough for client developers to act on. Implement RFC 7807 (Problem Details for HTTP APIs) — it's the standard format:

{
  "type": "https://api.example.com/errors/insufficient-funds",
  "title": "Insufficient Funds",
  "status": 402,
  "detail": "Your balance of $10.00 is below the required $49.99.",
  "instance": "/transactions/txn_abc123"
}

The type URI should resolve to documentation explaining the error. The instance URI identifies the specific request that failed. This format is machine-readable and human-understandable simultaneously.

Use our API Error Generator to design and preview RFC 7807 error payloads for your API. Test the actual HTTP responses your server returns with our cURL Generator — pipe the output through our JSON Formatter to inspect response bodies clearly.

Status Codes in Caching

Status codes affect how proxies and browsers cache responses:

Code Cacheable by default
200 Yes (with appropriate headers)
301 Yes (permanent)
302 No
404 Sometimes (brief negative cache)
500 No

Setting Cache-Control: no-store overrides this for any code. Understanding which codes are cached by default prevents surprising stale responses in CDN-heavy architectures.

Status codes are a contract between your API and its consumers. Use them precisely — the right code at the right time makes APIs self-documenting and dramatically reduces debugging time for everyone who integrates with you.

Frequently Asked Questions

Everything you need to know about the HTTP Status Codes and how your data is handled.

What do the different HTTP status code categories (1xx, 2xx, 3xx, 4xx, 5xx) mean?
1xx (Informational) are provisional responses used during connection setup (100 Continue, 101 Switching Protocols). 2xx (Success) indicate the request succeeded (200 OK, 201 Created, 204 No Content). 3xx (Redirection) tell the client to go to a different URL (301 Permanent, 302 Temporary, 304 Not Modified). 4xx (Client Error) mean the client's request is wrong (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable Entity). 5xx (Server Error) mean the server failed to fulfill a valid request (500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable).
What is the difference between 301 and 302 redirects for SEO?
A 301 Moved Permanently tells search engines the resource has permanently moved to the new URL. The original URL's PageRank and indexed links transfer to the new URL over time, and Google recrawls at a lower frequency. A 302 Found (temporary redirect) tells crawlers the move is temporary — the original URL should remain indexed and retain its authority. Using 302 when you intend a permanent redirect delays or prevents link equity transfer. For site migrations, URL slug changes, or consolidating duplicate content, always use 301.
When should an API return 400 versus 422?
400 Bad Request means the server cannot understand the request — the syntax is malformed, headers are invalid, or the body is unparseable JSON. 422 Unprocessable Entity (from WebDAV, adopted by REST APIs) means the request was syntactically valid and parseable, but the data failed business logic validation — for example, a missing required field, an invalid email format, or a date in the past when a future date is required. Use 400 for protocol-level failures and 422 for application-level validation errors to give clients more actionable error information.
What causes a 502 Bad Gateway error?
A 502 Bad Gateway occurs when a server acting as a proxy or gateway (like Nginx, a load balancer, or a CDN) receives an invalid or empty response from an upstream server. Common causes: the upstream application server crashed or is not running, the upstream timed out before responding, a deployment caused a brief period where no instances were available, or the upstream returned a response the gateway could not parse. Unlike 500 (which comes from your app server), 502 comes from the infrastructure layer in front of it.

Common Use Cases

  • API Debugging
  • SEO Analysis
  • Network Monitoring

Related Tools

Related Articles