HTTP Status Code Explorer
Look up any HTTP status code instantly. Searchable reference with descriptions, use cases, and tips for all standard status codes.
How to Use
- Browse all HTTP status codes organized by category (1xx through 5xx).
- Use the search bar to filter by code number or keyword (e.g., "timeout," "redirect," "404").
- Click any status code card to expand it and see a practical usage tip.
- Collapse or expand category sections by clicking their headers.
Understanding HTTP Status Codes
Every time your browser, mobile app, or API client makes an HTTP request to a server, the server responds with a three-digit status code. These codes are defined by the Internet Engineering Task Force (IETF) in various RFCs and are essential for building reliable web applications and APIs. Understanding what each code means helps developers debug issues faster, design better APIs, and build more robust error handling.
Status codes are grouped into five classes based on their first digit. 1xx codes are informational responses indicating that the server has received the request and the client should continue. 2xx codes indicate success — the request was received, understood, and accepted. 3xx codes indicate redirection — the client must take additional action to complete the request. 4xx codes indicate client errors — the request contains bad syntax or cannot be fulfilled. 5xx codes indicate server errors — the server failed to fulfill a valid request.
The Most Important Status Codes for REST APIs
When designing REST APIs, a handful of status codes cover the vast majority of use cases. 200 OK is the standard response for successful GET requests. 201 Created should be returned after a successful POST that creates a new resource, along with a Location header pointing to the new resource. 204 No Content is ideal for successful DELETE operations or PUT/PATCH updates where no response body is needed. 400 Bad Request covers malformed input or validation errors, while 422 Unprocessable Content is a more precise alternative for semantic validation failures. 401 Unauthorized signals missing or invalid authentication, and 403 Forbidden means the authenticated user lacks the required permissions.
For error handling, 404 Not Found is used when a resource does not exist, 409 Conflict indicates a state conflict such as a duplicate entry, and 429 Too Many Requests enforces rate limiting — always include a Retry-After header. On the server side, 500 Internal Server Error is the generic fallback, while 503 Service Unavailable is used during planned maintenance.
Common Mistakes with HTTP Status Codes
One of the most frequent mistakes is returning 200 OK for every response and embedding the actual error information in the response body. This anti-pattern breaks HTTP semantics and makes it impossible for middleware, caches, and monitoring tools to correctly interpret responses. If a request fails, return the appropriate 4xx or 5xx status code.
Another common mistake is confusing 401 and 403. Despite its name, 401 means "unauthenticated" (the user has not provided credentials), while 403 means "unauthorized" (the user is authenticated but lacks permission). Using them interchangeably leads to confusing user experiences and broken retry logic on the client side.
Developers also frequently misuse 302 Found for redirects. Historically, browsers changed POST requests to GET when following a 302 redirect, which was not the intended behavior. Use 303 See Other when you want to redirect a POST to a GET (the Post/Redirect/Get pattern), and 307 Temporary Redirect when the HTTP method must be preserved.
Status Codes and SEO
Search engines pay close attention to HTTP status codes. A 301 Moved Permanently redirect passes most of the original page's SEO ranking to the new URL, making it essential for site migrations and URL restructuring. A 302 Found redirect, on the other hand, tells search engines the move is temporary and the original URL should keep its ranking. Returning 404 Not Found for deleted content eventually causes search engines to drop the page from their index, while 410 Gone accelerates the de-indexing process. Soft 404s — pages that return a 200 status but display "not found" content — are penalized by Google because they waste crawl budget.
The 503 Service Unavailable code is critical during planned maintenance. When your site is temporarily down, returning 503 with a Retry-After header tells search engines to come back later without losing any rankings. Returning 500 or simply failing to respond during downtime can cause rankings to drop if the outage lasts more than a few hours.
Status Codes in Reverse Proxies and CDNs
When you run applications behind a reverse proxy such as Nginx, Apache, or a CDN like Cloudflare, the proxy layer can generate its own status codes. A 502 Bad Gateway means the proxy could not get a valid response from your application server — often because the app crashed or is not running. A 504 Gateway Timeout means the proxy gave up waiting for a response from the upstream server, typically due to slow database queries or unresponsive external API calls. Cloudflare adds its own non-standard codes (520-527) for edge-specific errors. Understanding which layer generated the error is essential for debugging production incidents.
Related Tools
Format API responses with the JSON Formatter. Decode authentication tokens with the JWT Decoder. Encode query parameters with the URL Encoder. Validate API response payloads with the JSON Validator. Generate hashes for ETag headers with the Hash Generator. Convert timestamps in API responses with the Epoch Converter.
Frequently Asked Questions
- What are HTTP status codes?
- HTTP status codes are three-digit numbers returned by a server in response to a client request. They indicate whether the request was successful, redirected, or resulted in an error. They are grouped into five classes: 1xx (informational), 2xx (success), 3xx (redirection), 4xx (client error), and 5xx (server error).
- What is the difference between 401 and 403?
- 401 Unauthorized means the client has not provided valid authentication credentials — the user needs to log in. 403 Forbidden means the client is authenticated but does not have permission to access the resource. In short: 401 is "who are you?" and 403 is "you cannot access this."
- When should I use 404 vs 410?
- Use 404 Not Found when a resource cannot be found and may or may not have existed previously. Use 410 Gone when a resource has been intentionally and permanently removed. A 410 tells search engines to de-index the URL, while a 404 may be rechecked later.
- What causes a 502 Bad Gateway error?
- A 502 Bad Gateway occurs when a server acting as a reverse proxy or gateway (such as Nginx or Cloudflare) receives an invalid or no response from the upstream application server. Common causes include the application server crashing, running out of memory, or not starting correctly.
- What is the 418 I'm a Teapot status code?
- HTTP 418 is a humorous status code defined in RFC 2324 as part of the Hyper Text Coffee Pot Control Protocol, an April Fools' joke from 1998. It states that a teapot cannot brew coffee. While not a real status code, it is widely known and sometimes used as an Easter egg in web applications.
AI agent tools available.
The CodeTidy MCP Server gives Claude, Cursor, and other AI agents
access to 47 developer tools. One command: npx @codetidy/mcp