What Are HTTP Status Codes?
HTTP response status codes are standardized three-digit integers issued by an origin web server or intermediary reverse proxy in response to a client request. Formally specified by the Internet Engineering Task Force (IETF) in RFC 9110 (HTTP Semantics) and maintained by the Internet Assigned Numbers Authority (IANA), status codes inform client web browsers, mobile applications, API SDKs, and search engine crawlers of the exact outcome of an HTTP transaction.
The first digit of the status code defines its general response category, while the subsequent two digits specify the detailed condition. Reason phrases (such as OK or Not Found) are standard recommendations defined in RFC 9110 §15, but servers may customize these human-readable strings without altering the underlying numeric protocol semantics.
How to Use the HTTP Status Code Reference & Lookup
Search by status code number (e.g. 404, 502), reason phrase (e.g. 'Not Found'), or keyword (e.g. 'rate limit', 'gateway timeout', 'precondition').
Filter by status class tabs (1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error) or inspect specific vendor codes.
Click any status card to inspect its complete RFC specification, plain-English summary, when to use, when NOT to use, and troubleshooting checklist.
Switch to the 'Which Status Code Should I Use?' tab to select your scenario (e.g. 'Resource created', 'Validation failed', 'Lost update prevention') and view recommended codes.
Open the 'Compare Codes' tab to view side-by-side diffs (e.g. 401 vs 403, 301 vs 302, 307 vs 308, 502 vs 504) comparing usage, retryability, and caching.
Deep-link directly to any status code using URL anchors (e.g. #404 or #502) or copy code definitions to clipboard with instant feedback.
The Five HTTP Status Code Classes (1xx–5xx)
RFC 9110 partitions all valid HTTP response status codes into five distinct classes based on their first digit:
Provisional responses indicating that the request was received and processing continues. 1xx responses never contain a message body and must be followed by a final status code (e.g. 100 Continue, 101 Switching Protocols, 103 Early Hints).
Indicates that the client's request was successfully received, understood, and accepted by the server (e.g. 200 OK, 201 Created, 202 Accepted, 204 No Content, 206 Partial Content).
Indicates that further action needs to be taken by the user agent to complete the request, typically via a target URI specified in the Location response header (e.g. 301, 302, 304, 307, 308).
Indicates that the client seems to have erred (such as malformed syntax, unauthenticated request, unauthorized permissions, missing resources, or rate limits: 400, 401, 403, 404, 422, 429).
Indicates that the server or intermediate reverse proxy encountered an internal error while processing an apparently valid request (e.g. unhandled exceptions, backend proxy failures, or timeouts: 500, 502, 503, 504).
Quick HTTP Status Code Cheat Sheet & Comparison
| Code | Status Name | Class | Plain-English Meaning | Specification |
|---|---|---|---|---|
| 200 | OK | 2xx | Standard success for GET, PUT, and action requests. | RFC 9110 §15.3.1 |
| 201 | Created | 2xx | New resource successfully created (POST/PUT). Includes Location header. | RFC 9110 §15.3.2 |
| 202 | Accepted | 2xx | Request accepted for asynchronous background processing. | RFC 9110 §15.3.3 |
| 204 | No Content | 2xx | Request succeeded; no message body returned (DELETE/PUT). | RFC 9110 §15.3.5 |
| 206 | Partial Content | 2xx | Fulfilling Range request for audio/video streaming or resumed download. | RFC 9110 §15.3.7 |
| 301 | Moved Permanently | 3xx | Permanent URL change; search engines transfer SEO ranking signals. | RFC 9110 §15.4.2 |
| 302 | Found | 3xx | Temporary redirect; historically rewrote POST to GET. | RFC 9110 §15.4.3 |
| 303 | See Other | 3xx | Redirects specifically to another URI using a GET request. | RFC 9110 §15.4.4 |
| 304 | Not Modified | 3xx | Cached representation is still fresh (ETag or If-Modified-Since match). | RFC 9110 §15.4.5 |
| 307 | Temporary Redirect | 3xx | Temporary redirect strictly preserving HTTP method and body. | RFC 9110 §15.4.8 |
| 308 | Permanent Redirect | 3xx | Permanent redirect strictly preserving HTTP method and body. | RFC 9110 §15.4.9 |
| 400 | Bad Request | 4xx | Malformed syntax, invalid JSON syntax, or unparseable headers. | RFC 9110 §15.5.1 |
| 401 | Unauthorized | 4xx | Missing or invalid authentication credentials (user is anonymous). | RFC 9110 §15.5.2 |
| 403 | Forbidden | 4xx | Authenticated identity lacks required authorization permissions. | RFC 9110 §15.5.4 |
| 404 | Not Found | 4xx | Requested resource URI does not exist on origin server. | RFC 9110 §15.5.5 |
| 405 | Method Not Allowed | 4xx | Endpoint does not support request method; includes Allow header. | RFC 9110 §15.5.6 |
| 409 | Conflict | 4xx | Resource state conflict (e.g. duplicate unique key, edit collision). | RFC 9110 §15.5.10 |
| 410 | Gone | 4xx | Resource permanently purged; crawlers should de-index immediately. | RFC 9110 §15.5.11 |
| 412 | Precondition Failed | 4xx | Conditional headers (If-Match) evaluated to false on server. | RFC 9110 §15.5.13 |
| 413 | Content Too Large | 4xx | Request body or uploaded file exceeds allowed server size limits. | RFC 9110 §15.5.14 |
| 415 | Unsupported Media Type | 4xx | Server cannot decode the request payload Content-Type. | RFC 9110 §15.5.16 |
| 422 | Unprocessable Content | 4xx | Valid JSON syntax but fails field validation / business rules. | RFC 9110 §15.5.21 |
| 429 | Too Many Requests | 4xx | Client exceeded rate limits; should inspect Retry-After header. | RFC 6585 §4 |
| 500 | Internal Server Error | 5xx | Unhandled server runtime exception or database crash. | RFC 9110 §15.6.1 |
| 501 | Not Implemented | 5xx | Server does not support the functionality required to fulfill request. | RFC 9110 §15.6.2 |
| 502 | Bad Gateway | 5xx | Reverse proxy received invalid response from upstream backend. | RFC 9110 §15.6.3 |
| 503 | Service Unavailable | 5xx | Temporary server overload or scheduled maintenance outage. | RFC 9110 §15.6.4 |
| 504 | Gateway Timeout | 5xx | Reverse proxy timed out waiting for upstream application to reply. | RFC 9110 §15.6.5 |
Frequently Encountered HTTP Status Codes
200 OK indicates standard read or action completion with payload. 201 Created is strictly for operations that create a new database entity and must return its new URI in the Location header. 204 No Content confirms action success (such as DELETE) while guaranteeing that no response body is sent.
Both instruct clients and search engines that the URL moved permanently. However, legacy browsers historically rewrote POST requests into GET upon receiving 301 Moved Permanently. Modern REST APIs use 308 Permanent Redirect to strictly preserve the HTTP method and request payload body.
400 Bad Request is for syntax-level failures—malformed JSON, broken brackets, invalid encoding, or unparseable headers. 422 Unprocessable Content is for semantic-level failures where JSON syntax is completely valid, but field values violate validation rules (e.g. password too short, age must be positive).
404 Not Found indicates no representation is available right now, but it might return in the future; search crawlers will revisit before dropping the page. 410 Gone explicitly states the resource was intentionally purged with no forwarding address, instructing search engines to de-index the page immediately.
How to Troubleshoot Common HTTP Errors
Troubleshooting 401 UnauthorizedAuth Credential Check
- Inspect request
Authorization: Bearer <token>header for expiration or truncation. - Verify that the server response returns a valid
WWW-Authenticatechallenge header. - Check whether session cookies or cross-site credentials were included in fetch/CORS requests.
Troubleshooting 403 ForbiddenPermissions & RBAC
- Confirm the user account role has permissions for the resource (e.g. admin vs member).
- Inspect IP allowlists or firewall rules blocking the client's source IP subnet.
- Verify CSRF token validity on state-changing web form submissions.
Troubleshooting 429 Too Many RequestsRate Limits
- Read the
Retry-Afterresponse header to know the exact waiting interval. - Implement client-side exponential backoff with randomized jitter to prevent burst storms.
- Check if multiple instances share the same public NAT IP or API key quota.
Troubleshooting 500 / 502 / 504 ErrorsServer & Proxy Failures
- 500: Check origin application error logs for unhandled null-pointer or database exceptions.
- 502: Verify upstream service process is running (e.g. Node/Python daemon listening on local port).
- 504: Inspect database query execution times, upstream HTTP call timeouts, or gateway proxy read limits.
HTTP Status Codes in REST APIs
Designing predictable REST APIs requires aligning HTTP status codes with HTTP method semantics, response headers, and RFC 7807 problem details:
| API Scenario | Recommended Code | Standard Name | API Design Rationale |
|---|---|---|---|
| Resource successfully created via POST | 201 | Created | Signals new entity creation. Include Location: /items/123 header. |
| Long-running async job queued | 202 | Accepted | Signals request was queued. Return job status polling URL. |
| Resource deleted via DELETE | 204 | No Content | Confirm deletion without sending unnecessary payload bytes. |
| Malformed JSON syntax or missing headers | 400 | Bad Request | Request syntax cannot be parsed by the server. |
| Missing or invalid Bearer token / API key | 401 | Unauthorized | User must authenticate. Include WWW-Authenticate header. |
| User logged in but lacks RBAC permissions | 403 | Forbidden | Authenticated user is not authorized to perform action. |
| Item ID not found in database | 404 | Not Found | Target entity does not exist. |
| Endpoint exists but method not supported | 405 | Method Not Allowed | Method unsupported. Must include Allow header (e.g. Allow: GET, HEAD). |
| Duplicate unique key (e.g. email exists) | 409 | Conflict | Request conflicts with existing resource state. |
| Optimistic locking collision (stale ETag) | 412 | Precondition Failed | If-Match ETag did not match current server state; prevents lost updates. |
| Payload / file upload exceeds limit | 413 | Content Too Large | Payload exceeds server buffer limits. |
| Unsupported Content-Type payload format | 415 | Unsupported Media Type | Server cannot decode incoming payload format. |
| Input field validation failed (valid JSON) | 422 | Unprocessable Content | Standard for semantic validation error responses. |
| Client exceeded API rate limit threshold | 429 | Too Many Requests | Rate limit exceeded. Include Retry-After: <seconds> header. |
HTTP Redirect Codes Explained (301, 302, 303, 307, 308)
Redirect codes differ primarily in two dimensions: Permanence (permanent vs. temporary) and Method Preservation (whether the HTTP method and body are preserved or rewritten to GET):
| Code | Standard Name | Permanence | Method Handling | Recommended Use Case |
|---|---|---|---|---|
| 301 | Moved Permanently | Permanent | May rewrite POST to GET (historical browser practice) | Website migrations, canonical URLs, transferring SEO PageRank. |
| 302 | Found | Temporary | May rewrite POST to GET (Post/Redirect/Get pattern) | Web form submissions where switching POST to GET prevents resubmission. |
| 303 | See Other | Temporary | Explicitly mandates switching method to GET | Directing users to a confirmation or status page after a write operation. |
| 307 | Temporary Redirect | Temporary | Strictly preserves method & body (POST stays POST) | API endpoints undergoing temporary maintenance or routing shifts. |
| 308 | Permanent Redirect | Permanent | Strictly preserves method & body (POST stays POST) | Modern REST API endpoint URL changes; preserves payloads. |
Common HTTP Status Code Misconceptions
The historical naming is inverted: 401 Unauthorized actually means unauthenticated (credentials missing or invalid). 403 Forbidden means unauthorized (identity verified, but access denied).
{ error: true } is fineThis masks failures from CDNs, reverse proxies, and HTTP client retry hooks. Always return standard 4xx or 5xx codes so infrastructure layers can respond appropriately.
502 and 504 are generated by intermediary gateways (Nginx, Cloudflare, ALB), not origin web application code. 502 indicates invalid upstream socket responses; 504 indicates upstream read timeouts.
A 500 error could be an unhandled database exception, memory overflow, syntax crash, or missing environment variable. Detailed debugging requires server application logs and structured problem details (RFC 7807).