HTTP status codes are grouped into 5 categories based on their first digit.
Each category has common codes you should know for development and interviews.
- Request was received and understood.
- Server is still processing the request.
- Rarely seen in practice.
- 100 Continue β Initial part of request received, client should continue.
- 101 Switching Protocols β Protocol change requested by client is accepted.
- 102 Processing β Server has received request and is processing, but no response yet.
- Request was successfully received, understood, and processed.
- 200 OK β Standard success response.
- 201 Created β Resource successfully created.
- 202 Accepted β Request accepted for processing, not completed yet.
- 204 No Content β Request processed successfully, no response body.
- Further action needed to complete the request.
- Often used for URL redirects.
- 301 Moved Permanently β Resource moved to a new permanent URL.
- 302 Found β Temporary redirect.
- 304 Not Modified β Cached version can be used, no need to download again.
- 307 Temporary Redirect β Similar to
302, but keeps request method (e.g., POST stays POST). - 308 Permanent Redirect β Like
301, but keeps request method.
- Error occurred on the clientβs side.
- Usually due to bad requests, missing data, or lack of permissions.
- 400 Bad Request β Invalid syntax or malformed request.
- 401 Unauthorized β Authentication required (or failed).
- 403 Forbidden β Client authenticated but not allowed to access resource.
- 404 Not Found β Resource not found on the server.
- 405 Method Not Allowed β HTTP method not supported by resource.
- 408 Request Timeout β Client took too long to send request.
- 429 Too Many Requests β Client sent too many requests in a given time.
- Error occurred on the serverβs side while processing request.
- 500 Internal Server Error β Generic server failure.
- 501 Not Implemented β Server does not support requested functionality.
- 502 Bad Gateway β Invalid response from upstream server.
- 503 Service Unavailable β Server overloaded or down for maintenance.
- 504 Gateway Timeout β Upstream server did not respond in time.
- 505 HTTP Version Not Supported β Server doesnβt support requested HTTP version.