HTTP STATUS CODES

Complete reference + live URL tester

LIVE TESTER

REFERENCE

1xx Informational
100 Continue

The client should continue sending the request body. The server has received the headers.

WHEN TO USE

Used with Expect: 100-continue header to avoid sending large bodies unnecessarily.

MDN ↗
101 Switching Protocols

The server agrees to switch protocols as requested by the client.

WHEN TO USE

Sent in response to an Upgrade request (e.g., upgrading to WebSocket).

MDN ↗
102 Processing

The server has received and is processing the request, but no response is available yet.

WHEN TO USE

WebDAV — prevents client timeout when a long operation is in progress.

MDN ↗
103 Early Hints

Return preliminary HTTP headers before final response to let the browser preload resources.

WHEN TO USE

Performance optimization — send Link headers early so the browser starts fetching assets.

MDN ↗
2xx Success
200 OK

The request succeeded. The meaning depends on the HTTP method used.

WHEN TO USE

Standard success response for GET, POST, PUT, PATCH, DELETE.

MDN ↗
201 Created

The request succeeded and a new resource was created as a result.

WHEN TO USE

Return after POST or PUT that creates a new resource. Include Location header.

MDN ↗
202 Accepted

The request has been received but not yet acted upon. It is noncommittal.

WHEN TO USE

Async processing — request is queued/scheduled but not complete yet.

MDN ↗
204 No Content

The server successfully processed the request and is not returning any content.

WHEN TO USE

DELETE, or PUT/PATCH when no body needed in response. Also CORS preflight.

MDN ↗
206 Partial Content

The server is delivering only part of the resource due to a range request from the client.

WHEN TO USE

Range requests (e.g., video streaming, resumable downloads). Requires Range header.

MDN ↗
207 Multi-Status

The response body contains multiple status codes for different sub-requests.

WHEN TO USE

WebDAV bulk operations (PROPFIND, MULTI-STATUS).

MDN ↗
3xx Redirection
301 Moved Permanently

The URL of the requested resource has been changed permanently. The new URL is in the Location header.

WHEN TO USE

Permanent URL changes — HTTP to HTTPS redirect, domain changes. Browsers cache this.

MDN ↗
302 Found

The resource is temporarily located at a different URL. Future requests should use the original URL.

WHEN TO USE

Temporary redirects. Note: many clients change POST to GET after following. Use 307 to preserve method.

MDN ↗
303 See Other

Redirect the client to GET another resource. Used after POST to redirect to a results page.

WHEN TO USE

Post/Redirect/Get pattern. Prevents double-submission on browser refresh.

MDN ↗
304 Not Modified

The response has not been modified. Client can use its cached version.

WHEN TO USE

Conditional GET requests using If-None-Match or If-Modified-Since headers.

MDN ↗
307 Temporary Redirect

Temporary redirect that preserves the original HTTP method and body.

WHEN TO USE

Like 302, but guarantees method is preserved (POST → POST, not POST → GET).

MDN ↗
308 Permanent Redirect

Permanent redirect that preserves the HTTP method. Like 301 but method is not changed.

WHEN TO USE

Permanent URL migration where you need POST/PUT to remain POST/PUT.

MDN ↗
4xx Client Error
400 Bad Request

The server cannot process the request due to a client error (malformed syntax, invalid framing, etc.).

WHEN TO USE

Invalid JSON body, missing required fields, malformed query params, validation errors.

MDN ↗
401 Unauthorized

The client must authenticate itself to get the requested response.

WHEN TO USE

Missing or invalid authentication credentials. Include WWW-Authenticate header.

MDN ↗
403 Forbidden

The client does not have access rights to the content. Unlike 401, the client's identity is known.

WHEN TO USE

Authenticated but not authorized. User lacks permission for this action/resource.

MDN ↗
404 Not Found

The server cannot find the requested resource. The URL is not recognized.

WHEN TO USE

Resource doesn't exist. Also used to hide 403 (not revealing protected resources exist).

MDN ↗
405 Method Not Allowed

The request method is known by the server but is not supported by the target resource.

WHEN TO USE

POST to a read-only endpoint, DELETE on a non-deletable resource. Must include Allow header.

MDN ↗
408 Request Timeout

The server would like to shut down this unused connection.

WHEN TO USE

Client took too long to send the request. Some servers send this on idle connections.

MDN ↗
409 Conflict

The request conflicts with the current state of the server.

WHEN TO USE

Duplicate resource creation, optimistic concurrency conflict, version mismatch.

MDN ↗
410 Gone

The content has been permanently deleted from the server, with no forwarding address.

WHEN TO USE

Resource intentionally removed and won't return. Unlike 404, indicates permanent removal.

MDN ↗
413 Content Too Large

The request body is larger than limits defined by server.

WHEN TO USE

File upload exceeds max size, request body too large. Include Retry-After if temporary.

MDN ↗
415 Unsupported Media Type

The media format of the requested data is not supported by the server.

WHEN TO USE

Wrong Content-Type header (e.g., sending XML to a JSON-only endpoint).

MDN ↗
418 I'm a Teapot

The server refuses to brew coffee because it is, permanently, a teapot.

WHEN TO USE

April Fools RFC 2324. Sometimes used as an Easter egg or to reject bad requests playfully.

MDN ↗
422 Unprocessable Content

The server understands the content type and syntax but cannot process the contained instructions.

WHEN TO USE

Validation errors — request is well-formed but semantically incorrect (e.g., invalid email format).

MDN ↗
429 Too Many Requests

The user has sent too many requests in a given amount of time.

WHEN TO USE

Rate limiting. Include Retry-After header with seconds or date to retry.

MDN ↗
451 Unavailable For Legal Reasons

The user requested a resource that cannot legally be provided.

WHEN TO USE

Content blocked by legal order (DMCA, court order, government censorship).

MDN ↗
5xx Server Error
500 Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

WHEN TO USE

Unhandled exception, bug, or unexpected server-side failure. Generic catch-all.

MDN ↗
501 Not Implemented

The request method is not supported by the server and cannot be handled.

WHEN TO USE

Server doesn't support the HTTP method. Differs from 405 (which means the method exists but not for this route).

MDN ↗
502 Bad Gateway

The server, while working as a gateway, received an invalid response from an upstream server.

WHEN TO USE

Reverse proxy (Nginx/Caddy) can't reach the upstream app. App crashed or wrong port.

MDN ↗
503 Service Unavailable

The server is not ready to handle the request. Common causes: maintenance or overload.

WHEN TO USE

Server down for maintenance, overloaded, or starting up. Include Retry-After header.

MDN ↗
504 Gateway Timeout

The server, acting as a gateway, did not receive a timely response from an upstream server.

WHEN TO USE

Upstream server took too long. Check app server timeout settings and slow queries.

MDN ↗
507 Insufficient Storage

The method could not be performed because the server cannot store the representation needed.

WHEN TO USE

Disk full on server. WebDAV context.

MDN ↗