HTTP Status Codes Reference
Complete guide to HTTP status codes with detailed descriptions
Continue
The server has received the request headers and the client should proceed to send the request body.
Switching Protocols
The requester has asked the server to switch protocols and the server has agreed to do so.
Processing
The server has received and is processing the request, but no response is available yet.
Early Hints
Used to return some response headers before final HTTP message.
OK
Standard response for successful HTTP requests. The actual response will depend on the request method used.
Created
The request has been fulfilled, resulting in the creation of a new resource.
Accepted
The request has been accepted for processing, but the processing has not been completed.
No Content
The server successfully processed the request and is not returning any content.
Partial Content
The server is delivering only part of the resource due to a range header sent by the client.
Moved Permanently
This and all future requests should be directed to the given URI.
Found
The resource was found but at a different URI. This is a temporary redirect.
See Other
The response to the request can be found under another URI using a GET method.
Not Modified
Indicates that the resource has not been modified since the version specified by the request headers.
Temporary Redirect
The request should be repeated with another URI; however, future requests should still use the original URI.
Permanent Redirect
The request and all future requests should be repeated using another URI.
Bad Request
The server cannot or will not process the request due to an apparent client error.
Unauthorized
Authentication is required and has failed or has not yet been provided.
Forbidden
The request was valid, but the server is refusing action. The user might not have the necessary permissions.
Not Found
The requested resource could not be found but may be available in the future.
Method Not Allowed
A request method is not supported for the requested resource.
Request Timeout
The server timed out waiting for the request.
Conflict
Indicates that the request could not be processed because of conflict in the request.
Gone
Indicates that the resource requested is no longer available and will not be available again.
Payload Too Large
The request is larger than the server is willing or able to process.
URI Too Long
The URI provided was too long for the server to process.
Unsupported Media Type
The request entity has a media type which the server or resource does not support.
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.
Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors.
Too Many Requests
The user has sent too many requests in a given amount of time ("rate limiting").
Internal Server Error
A generic error message when the server encounters an unexpected condition.
Not Implemented
The server either does not recognize the request method, or it lacks the ability to fulfill the request.
Bad Gateway
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
Service Unavailable
The server is currently unavailable (because it is overloaded or down for maintenance).
Gateway Timeout
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
HTTP Version Not Supported
The server does not support the HTTP protocol version used in the request.
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.
How It Works
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
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
• 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