Standard Documentation

The Ultimate HTTP Status Code Reference: Understanding 1xx to 5xx

Updated Jan 12, 202614 min read

Every time you click a link or submit a form, your browser and the server engage in a high-speed conversation. The most important part of this dialogue is the HTTP status code—a three-digit number that tells the browser exactly what happened with the request. Whether you're debugging an API or optimizing for SEO, understanding these codes is essential. That's why we created the HTTP Status Codes Reference Guide.

The Five Categories of HTTP Status Codes

HTTP status codes are divided into five distinct ranges, each indicating a different type of response:

1xx: Informational Responses

These codes tell the browser that the request was received and the process is continuing. They are rarely seen by end-users but are crucial for low-level protocol communication.

  • 101 Switching Protocols: The server agrees to change the application protocol (e.g., from HTTP to WebSockets).
  • 103 Early Hints: Helps the browser start preloading resources while the server prepares the main response.

2xx: Success Responses

The gold standard. These codes mean the request was successfully received, understood, and accepted by the server.

  • 200 OK: The most common code. The request succeeded, and the payload is returned.
  • 201 Created: Usually returned after a successful POST request, indicating a new resource was created.
  • 204 No Content: The request succeeded, but there's no data to send back (common for DELETE or PUT ops).

3xx: Redirection Responses

The server tells the browser that further action is needed to complete the request, usually by visiting a different URL.

  • 301 Moved Permanently: Crucial for SEO. Tells search engines to transfer link equity to the new URL.
  • 302 Found (Temporary Redirect): Use this when a page is temporarily moved (e.g., during maintenance).
  • 304 Not Modified: Essential for performance. Tells the browser to use its cached version because the content hasn't changed.

🚀 SEO Insight

Using a 302 redirect instead of a 301 for permanent changes is a common SEO mistake. Search engines may not pass the "link juice" to the new page if they think the move is only temporary.

4xx: Client Error Responses

Something went wrong on the user's side—a typo in the URL, missing authentication, or requesting a file that doesn't exist.

  • 400 Bad Request: The server cannot process the request due to invalid syntax.
  • 401 Unauthorized: Authentication is required and has failed or hasn't been provided.
  • 403 Forbidden: The server understands the request but refuses to fulfill it (authentication won't help).
  • 404 Not Found: The classic. The requested resource could not be found but may be available in the future.
  • 429 Too Many Requests: Rate limiting. The user has sent too many requests in a given amount of time.

5xx: Server Error Responses

The request was valid, but the server failed to fulfill it. These are the "scary" errors that usually require a developer to fix something on the backend.

  • 500 Internal Server Error: A generic catch-all for when something goes wrong on the server but no specific code applies.
  • 502 Bad Gateway: One server acting as a proxy received an invalid response from an upstream server.
  • 503 Service Unavailable: The server is currently unable to handle the request (usually due to overload or maintenance).
  • 504 Gateway Timeout: The server didn't get a timely response from an upstream server.

The Famous "Teapot" Error

Did you know there's a status code for teapots? 418 I'm a teapot was defined in the 1998 April Fools' IETF RFC. While not used in production, it's a favorite easter egg among developers and demonstrates the history and personality behind the HTTP protocol.

Why Proper Status Codes Matter

  1. User Experience: A clear error message (like a custom 404 page) is much better than a generic browser error.
  2. SEO Optimization: Search engines rely on status codes to know which pages to index and which to remove.
  3. API Reliability: Consistent status codes allow client applications to handle success and failure gracefully.
  4. Debugging: Status codes provide the first clue when troubleshooting network issues.

💡 Developer Tip

Always return a 422 Unprocessable Entity for validation errors in APIs. It's more specific than a 400 and tells the client exactly why the data provided couldn't be used.

Using the Devtobox Status Code Lookup

Our HTTP Status Codes Guide is designed for speed:

  • Instant Search: Type any code (like "404") or name (like "Forbidden") to find it immediately.
  • Category Filters: Quickly toggle between range groups (1xx, 2xx, etc.) to browse related codes.
  • Detailed Descriptions: Learn not just what the code is, but when and how to use it.
  • Color Coding: Visual cues help you distinguish between success (green), redirects (blue), and errors (red/orange).

Master the protocol and build better web applications today. Check out the complete HTTP Status Code Reference on Devtobox.

Copied to clipboard!
Quick Tools
JSON Formatter
Base64
Regex Tester
UUID
Password
URL Encode
Text Compare
String Utils