common.dev
2026-03-24
DevTools Team
Understanding HTTP Status Codes
Understanding HTTP Status Codes
HTTP status codes are like short notes from a server tacked onto a web page. They tell you whether things went well, or if something went wrong.
The Five Classes of Status Codes
- 1xx (Informational): The request was received, continuing process.
- 2xx (Success): The action was successfully received, understood, and accepted (e.g., 200 OK).
- 3xx (Redirection): Further action needs to be taken to complete the request (e.g., 301 Moved Permanently).
- 4xx (Client Error): The request contains bad syntax or cannot be fulfilled (e.g., 404 Not Found).
- 5xx (Server Error): The server failed to fulfill an apparently valid request (e.g., 500 Internal Server Error).
Common Codes You Should Know
- 200 OK: The standard response for successful HTTP requests.
- 201 Created: The request has been fulfilled and has resulted in one or more new resources being created.
- 400 Bad Request: The server cannot process the request due to a client error.
- 401 Unauthorized: Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.
- 403 Forbidden: The request was valid, but the server is refusing action.
- 404 Not Found: The requested resource could not be found but may be available in the future.
- 500 Internal Server Error: A generic error message, given when an unexpected condition was encountered.
Understanding these codes is essential for debugging web applications and building robust APIs.