HTTP Status Codes Reference

Complete guide to HTTP status codes with detailed descriptions

100
Informational

Continue

The server has received the request headers and the client should proceed to send the request body.

101
Informational

Switching Protocols

The requester has asked the server to switch protocols and the server has agreed to do so.

102
Informational

Processing

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

103
Informational

Early Hints

Used to return some response headers before final HTTP message.

200
Success

OK

Standard response for successful HTTP requests. The actual response will depend on the request method used.

201
Success

Created

The request has been fulfilled, resulting in the creation of a new resource.

202
Success

Accepted

The request has been accepted for processing, but the processing has not been completed.

204
Success

No Content

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

206
Success

Partial Content

The server is delivering only part of the resource due to a range header sent by the client.

301
Redirection

Moved Permanently

This and all future requests should be directed to the given URI.

302
Redirection

Found

The resource was found but at a different URI. This is a temporary redirect.

303
Redirection

See Other

The response to the request can be found under another URI using a GET method.

304
Redirection

Not Modified

Indicates that the resource has not been modified since the version specified by the request headers.

307
Redirection

Temporary Redirect

The request should be repeated with another URI; however, future requests should still use the original URI.

308
Redirection

Permanent Redirect

The request and all future requests should be repeated using another URI.

400
Client Error

Bad Request

The server cannot or will not process the request due to an apparent client error.

401
Client Error

Unauthorized

Authentication is required and has failed or has not yet been provided.

403
Client Error

Forbidden

The request was valid, but the server is refusing action. The user might not have the necessary permissions.

404
Client Error

Not Found

The requested resource could not be found but may be available in the future.

405
Client Error

Method Not Allowed

A request method is not supported for the requested resource.

408
Client Error

Request Timeout

The server timed out waiting for the request.

409
Client Error

Conflict

Indicates that the request could not be processed because of conflict in the request.

410
Client Error

Gone

Indicates that the resource requested is no longer available and will not be available again.

413
Client Error

Payload Too Large

The request is larger than the server is willing or able to process.

414
Client Error

URI Too Long

The URI provided was too long for the server to process.

415
Client Error

Unsupported Media Type

The request entity has a media type which the server or resource does not support.

418
Client Error

I'm a teapot

This code was defined in 1998 as one of the traditional IETF April Fools' jokes. The server refuses to brew coffee because it is a teapot.

422
Client Error

Unprocessable Entity

The request was well-formed but was unable to be followed due to semantic errors.

429
Client Error

Too Many Requests

The user has sent too many requests in a given amount of time ("rate limiting").

500
Server Error

Internal Server Error

A generic error message when the server encounters an unexpected condition.

501
Server Error

Not Implemented

The server either does not recognize the request method, or it lacks the ability to fulfill the request.

502
Server Error

Bad Gateway

The server was acting as a gateway or proxy and received an invalid response from the upstream server.

503
Server Error

Service Unavailable

The server is currently unavailable (because it is overloaded or down for maintenance).

504
Server Error

Gateway Timeout

The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.

505
Server Error

HTTP Version Not Supported

The server does not support the HTTP protocol version used in the request.

511
Server Error

Network Authentication Required

The client needs to authenticate to gain network access.

Understanding HTTP Status Codes

HTTP status codes are three-digit numbers returned by a server in response to a client's request. They indicate whether a specific HTTP request has been successfully completed and provide information about the result.

1xx
Informational responses indicating the request was received and is being processed.
2xx
Success codes indicating the request was successfully received, understood, and accepted.
3xx
Redirection codes indicating further action needs to be taken to complete the request.
4xx
Client error codes indicating the request contains bad syntax or cannot be fulfilled.
5xx
Server error codes indicating the server failed to fulfill a valid request.

How It Works

HTTP (HyperText Transfer Protocol) status codes are three-digit numbers sent by web servers in response to client requests. They are defined in RFC 7231 (and related specifications) and are organized into five classes indicated by the first digit: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Error), and 5xx (Server Error).



When a browser requests a web page or when an API client makes a call, the server's response always includes a status code. The code tells the client whether the request succeeded, failed, and why. The browser uses these codes to decide what to display (200 = show content, 404 = show error page, 301 = follow redirect, 401 = show login).



Status codes are also critical for web crawlers, search engines, and API clients. Google's Googlebot uses status codes to determine whether pages should be indexed (200), removed from index (404/410), or if the crawler should follow a redirect (301). API clients use status codes for error handling logic—retrying on 503, handling 401 by refreshing tokens, and displaying user-friendly messages for 4xx errors.

Use Cases

1. API Development and Design
REST API designers choose appropriate status codes to communicate results clearly. Using 201 (Created) instead of 200 for successful resource creation, 422 (Unprocessable Entity) for validation errors, and 429 (Too Many Requests) for rate limiting follows established conventions that API consumers expect and can handle automatically.



2. Error Page Configuration
Web servers and CDNs allow custom error pages for specific status codes. Configuring custom 404 pages that suggest related content, 500 pages that apologize and provide support contact, and 503 pages explaining maintenance windows improves user experience during errors.



3. SEO and Search Engine Crawling
Search engine optimization requires understanding how status codes affect indexing. 301 permanent redirects pass "link equity" to the new URL; 302 temporary redirects do not. 404 pages for deleted content should eventually become 301s if the content moved, or 410 (Gone) if permanently removed.



4. Debugging and Monitoring
Application monitoring tools (Datadog, New Relic) track the distribution of HTTP status codes over time. A spike in 5xx errors indicates server problems; increased 4xx errors might indicate a broken link or API change. Understanding codes enables meaningful alerting rules.



5. Security Implementations
Proper use of 401 (Unauthorized) versus 403 (Forbidden) has security implications. 401 indicates authentication is needed; 403 means authenticated but not authorized. Using 403 for non-existent resources (instead of 404) can leak information about what resources exist. Understanding the security implications of status codes is part of secure web development.

Tips & Best Practices

Use 400 for client errors, 500 for server errors: 4xx codes indicate the client made an error (wrong input, missing auth); 5xx codes indicate the server failed. Using the right range communicates responsibility correctly and helps with monitoring.



Prefer 404 over 403 for security: Returning 404 for unauthorized resources prevents information disclosure—attackers can't enumerate which resources exist by looking for 403 responses.



Use 301 for permanent redirects: When pages move permanently, use 301. Browsers and search engines cache 301s, so future requests go directly to the new URL. 302 (temporary) is appropriate for genuinely temporary redirects, like maintenance pages.



Return meaningful error bodies: Status codes alone don't explain what went wrong. Always include a response body with error details for 4xx and 5xx responses, especially for APIs where clients need to handle errors programmatically.



Don't use 200 for errors: Some older APIs return HTTP 200 with an error message in the body. This breaks standard monitoring tools and forces clients to parse every response body. Return appropriate non-200 codes for error conditions.

Frequently Asked Questions

Related Tools

Explore more tools that might help you