Skip to content
back to cheatsheets

HTTP Status Codes — Complete Reference Guide

· Reference

HTTP status codes are three-digit numbers returned by a server in response to a client request. They tell you whether a request succeeded, was redirected, or failed — and why. Every web developer needs to know these codes for debugging APIs, configuring servers, and building error handling.

1xx — Informational

The server received the request and is continuing to process it.

CodeNameDescription
100ContinueThe server received the request headers. The client should proceed to send the body.
101Switching ProtocolsThe server is switching to a different protocol (e.g., upgrading to WebSocket).
102ProcessingThe server is processing the request but has no response yet (WebDAV).
103Early HintsUsed to return some response headers before the final response, often for preloading resources.

2xx — Success

The request was received, understood, and accepted.

CodeNameDescription
200OKStandard success response. GET returns data; POST returns the result.
201CreatedA new resource was successfully created. Common after POST requests.
202AcceptedThe request was accepted for processing but not yet completed. Used for async operations.
203Non-Authoritative InformationThe response metadata comes from a third-party copy, not the origin server.
204No ContentSuccess, but there is no body to return. Common for DELETE or PUT responses.
205Reset ContentLike 204, but tells the client to reset the document view.
206Partial ContentThe server is returning part of the resource due to a Range header. Used for resumable downloads.
207Multi-StatusMultiple status codes for multiple sub-requests (WebDAV).
208Already ReportedMembers of a DAV binding have already been enumerated (WebDAV).
226IM UsedThe server fulfilled a GET request with instance-manipulations applied.

3xx — Redirection

The client needs to take additional action to complete the request.

CodeNameDescriptionCaches?
300Multiple ChoicesMultiple options available for the resource. Rare in practice.No
301Moved PermanentlyThe resource has been permanently moved to a new URL. Search engines transfer ranking.Yes
302FoundTemporary redirect. The resource is temporarily at a different URL.No
303See OtherThe response can be found at a different URL using GET. Often used after POST.No
304Not ModifiedThe resource has not changed since the last request. Browser uses cached version.N/A
307Temporary RedirectLike 302, but the HTTP method must not change (POST stays POST).No
308Permanent RedirectLike 301, but the HTTP method must not change.Yes

When to use which redirect:

  • 301 for permanent URL changes (old blog URL to new)
  • 302 for temporary redirects (maintenance page)
  • 307 when you need to preserve the POST method during a temporary redirect
  • 308 when you need to preserve the POST method during a permanent redirect

4xx — Client Error

The request contains bad syntax or cannot be fulfilled.

CodeNameCommon Cause
400Bad RequestMalformed JSON, missing required fields, invalid query parameters.
401UnauthorizedMissing or invalid authentication credentials. The user needs to log in.
402Payment RequiredReserved for future use. Some APIs use it for billing-related rejections.
403ForbiddenThe server understood the request but refuses to authorize it. User is authenticated but lacks permission.
404Not FoundThe resource does not exist at the given URL. The most common error on the web.
405Method Not AllowedThe HTTP method (GET, POST, etc.) is not supported for this endpoint.
406Not AcceptableThe server cannot produce a response matching the Accept headers sent by the client.
407Proxy Authentication RequiredLike 401, but for a proxy server.
408Request TimeoutThe server timed out waiting for the request. The client took too long.
409ConflictThe request conflicts with the current state of the resource. Common in version control APIs.
410GoneThe resource existed but has been permanently removed. Unlike 404, this is deliberate.
411Length RequiredThe server requires a Content-Length header.
412Precondition FailedA condition in the request headers (If-Match, If-Unmodified-Since) was not met.
413Content Too LargeThe request body exceeds the server’s size limit.
414URI Too LongThe URL is too long for the server to process.
415Unsupported Media TypeThe Content-Type of the request body is not supported.
416Range Not SatisfiableThe Range header value is outside the resource’s size.
418I’m a TeapotAn April Fools’ joke from RFC 2324. Some servers return it as an easter egg.
422Unprocessable ContentThe syntax is correct but the server cannot process the instructions. Common in REST APIs for validation errors.
423LockedThe resource is locked (WebDAV).
424Failed DependencyThe request failed due to a previous request failure (WebDAV).
425Too EarlyThe server is unwilling to process a request that might be replayed.
426Upgrade RequiredThe server refuses the request using the current protocol. Client must upgrade (e.g., to TLS).
428Precondition RequiredThe server requires the request to be conditional (e.g., If-Match header).
429Too Many RequestsRate limiting. The client has sent too many requests in a given time period.
431Request Header Fields Too LargeOne or more header fields are too large.
451Unavailable For Legal ReasonsThe resource is blocked for legal reasons (censorship, GDPR). Named after Fahrenheit 451.

5xx — Server Error

The server failed to fulfill a valid request.

CodeNameCommon Cause
500Internal Server ErrorAn unhandled exception or generic error on the server. Check your server logs.
501Not ImplementedThe server does not support the HTTP method used.
502Bad GatewayThe server, acting as a gateway or proxy, received an invalid response from the upstream server.
503Service UnavailableThe server is down for maintenance or is overloaded. Usually temporary.
504Gateway TimeoutThe server, acting as a gateway, did not receive a timely response from the upstream server.
505HTTP Version Not SupportedThe server does not support the HTTP version in the request.
506Variant Also NegotiatesA configuration error in content negotiation.
507Insufficient StorageThe server cannot store the representation needed to complete the request (WebDAV).
508Loop DetectedThe server detected an infinite loop while processing the request (WebDAV).
510Not ExtendedFurther extensions to the request are required.
511Network Authentication RequiredThe client needs to authenticate to gain network access (captive portals).

Quick Decision Guide

Is the request malformed?           → 400 Bad Request
Is auth missing?                    → 401 Unauthorized
Is auth valid but insufficient?     → 403 Forbidden
Does the resource not exist?        → 404 Not Found
Is the resource permanently gone?   → 410 Gone
Is the user sending too fast?       → 429 Too Many Requests
Did your server crash?              → 500 Internal Server Error
Is the upstream server down?        → 502 Bad Gateway
Is the server overloaded?           → 503 Service Unavailable

Look up any status code instantly with the HTTP Status Codes tool or the Status Code Finder.

#Learn More