What Are HTTP Status Codes?
When you click a link, type a URL, or submit a form, your browser sends an HTTP request to a web server. The server processes this request and returns an HTTP response with two critical pieces of information:
- A status code indicating success, failure, or other outcomes
- The requested content (for successful requests)
HTTP status codes are grouped into five classes, with each class serving a specific purpose:
Range | Category | Description |
---|---|---|
100-199 | Informational | The request was received and is being processed |
200-299 | Success | The request was successfully received, understood, and accepted |
300-399 | Redirection | Further action is needed to complete the request |
400-499 | Client Error | The request contains bad syntax or cannot be fulfilled by the server |
500-599 | Server Error | The server failed to fulfill a valid request |
Common HTTP Status Codes
Success (2xx)
These codes indicate that the request was successful. The most common success code is:
- 200 OK - The request succeeded. The content returned with the response provides the requested resource.
- 201 Created - The request has been fulfilled and a new resource has been created.
- 204 No Content - The server successfully processed the request but there's no content to return.
Redirection (3xx)
These codes indicate that the client must take additional action to complete the request:
- 301 Moved Permanently - The requested resource has been permanently moved to a new URL.
- 302 Found - The requested resource is temporarily located at a different URL.
- 304 Not Modified - The resource has not been modified since the last request, so the client can use its cached version.
- 307 Temporary Redirect - Similar to 302, but the client must use the same HTTP method for the redirected request.
- 308 Permanent Redirect - Similar to 301, but the client must use the same HTTP method for the redirected request.
Client Errors (4xx)
These codes indicate that the client appears to have made an error:
- 400 Bad Request - The server cannot process the request due to a client error (malformed request syntax, invalid request framing, or deceptive request routing).
- 401 Unauthorized - Authentication is required and has failed or has not been provided.
- 403 Forbidden - The server understood the request but refuses to authorize it.
- 404 Not Found - The server cannot find the requested resource.
- 405 Method Not Allowed - The request method is known by the server but is not supported by the target resource.
- 429 Too Many Requests - The user has sent too many requests in a given amount of time ("rate limiting").
Note: A 404 error doesn't necessarily mean the entire website is down. It often means that a specific page doesn't exist. If you're trying to access example.com/page and get a 404 error, the main website (example.com) might still be working correctly.
Server Errors (5xx)
These codes indicate that the server failed to fulfill a valid request:
- 500 Internal Server Error - The server encountered an unexpected condition that prevented it from fulfilling the request.
- 502 Bad Gateway - The server, while acting as a gateway or proxy, received an invalid response from an upstream server.
- 503 Service Unavailable - The server is not ready to handle the request, often due to maintenance or overloading.
- 504 Gateway Timeout - The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server.
Important: 5xx errors indicate server-side problems and cannot typically be fixed by the website visitor. If you encounter a 5xx error, the best approach is to wait and try again later, as the website owners need to resolve the issue on their end.
How to Use HTTP Status Codes for Troubleshooting
Understanding HTTP status codes can help you diagnose issues with websites:
- If you see a 2xx code: The request was successful, but there might be issues with how the content is displayed in your browser.
- If you see a 3xx code: The resource has moved. In most cases, your browser automatically follows redirects, but sometimes this can cause issues, especially with multiple redirects.
- If you see a 4xx code: There's likely an issue with your request, such as a typo in the URL, expired session, or missing authentication.
- If you see a 5xx code: There's an issue with the server. This often means the website is experiencing problems that need to be fixed by its administrators.
How to Check HTTP Status Codes
There are several ways to view HTTP status codes:
- Browser Developer Tools: Press F12 in most browsers, go to the Network tab, then refresh the page to see the status codes for all resources.
- Online Tools: Use our Website Status Checker to check the status code of any website.
- Command Line: Use tools like curl or wget to make requests and view response codes.