HTTP Status Codes Reference
What are HTTP Status Codes?
HTTP status codes are 3-digit numbers returned by a web server in every HTTP response, indicating the result of the client's request. They're grouped into five classes: 1xx informational (the request was received and is being processed), 2xx success (the request was received, understood, and accepted β 200 OK, 201 Created, 204 No Content), 3xx redirection (further action is required β 301 Moved Permanently, 302 Found, 304 Not Modified), 4xx client errors (the request contains an error β 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests), and 5xx server errors (the server failed to fulfil a valid request β 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable). Understanding status codes is fundamental for debugging APIs, web servers, and network issues.
How to Use This Reference
-
Search by code number (e.g. 404) or keyword (e.g. 'timeout', 'redirect', 'forbidden').
-
Filter by category using the buttons: Informational, Success, Redirection, Client Errors, Server Errors.
-
Click any status code card to expand its full description and usage guidance.
Frequently Asked Questions
What is the difference between 401 and 403? 401 Unauthorized means the client is not authenticated β it doesn't know who you are (usually requires a login or API key). 403 Forbidden means the server knows who you are but you don't have permission to access the resource. Authentication might fix a 401; a 403 is an authorization issue.
What is the difference between 301 and 302 redirects? 301 Moved Permanently tells clients and search engines that the resource has moved to a new URL forever β browsers and bots cache this redirect. 302 Found is a temporary redirect β clients should continue using the original URL. Use 301 for permanent URL changes and 302 for temporary redirections.
When should an API return 400 vs 422? 400 Bad Request is used when the request is malformed or syntactically incorrect (e.g. invalid JSON). 422 Unprocessable Entity is used when the request is syntactically valid but semantically incorrect (e.g. a date field contains a past date that violates business rules). REST APIs commonly use 422 for validation errors.
What causes a 502 Bad Gateway? 502 Bad Gateway means a server acting as a proxy (like Nginx or a load balancer) received an invalid response from an upstream server. Common causes include the backend application crashing, timing out, or returning a non-HTTP response. Check your application server logs rather than the proxy.
Keywords: HTTP status codes, HTTP error codes, 404 not found, 500 internal server error, 200 OK, 301 redirect, 403 forbidden, REST API status codes, HTTP response codes