Skip to content
Home » Understanding HTTP Status Codes: A Simple Breakdown

Understanding HTTP Status Codes: A Simple Breakdown

HTTP Status Code

When a browser requests data from a web server, it always gets a response, which could indicate success, redirection, client-side issues, or server problems. These responses are known as HTTP status messages.

Each response is grouped into categories, such as 1xx for informational updates, 2xx for successful requests, 3xx for redirects, 4xx for client errors, and 5xx for server-side failures. Below is a breakdown of these status codes.

CategoryCodeMessageMeaning
1xx – Information100ContinueRequest headers received, send body next.
101Switching ProtocolsServer switching to requested protocol.
103Early HintsServer sends hints for faster loading.
2xx – Success200OKRequest processed successfully.
201CreatedNew resource successfully generated.
202AcceptedRequest received but still processing.
204No ContentRequest succeeded, but no content returned.
3xx – Redirection301Moved PermanentlyResource has a new permanent URL.
302FoundTemporary relocation of the requested content.
304Not ModifiedContent remains unchanged since last request.
4xx – Client Errors400Bad RequestRequest is incorrect or malformed.
401UnauthorizedAuthentication required but missing.
403ForbiddenAccess denied to the resource.
404Not FoundRequested content does not exist.
405Method Not AllowedRequest method is not permitted.
5xx – Server Errors500Internal Server ErrorServer encountered an unexpected issue.
502Bad GatewayReceived invalid response from another server.
503Service UnavailableServer is overloaded or in maintenance mode.
504Gateway TimeoutServer took too long to respond.

🔹 1xx – Informational

  • 100 Continue: The server has received the request headers, and the client should proceed with sending data.
  • 101 Switching Protocols: The server acknowledges a request to switch to a different communication method.
  • 103 Early Hints: The server sends preliminary information to help the client prepare resources faster.

✅ 2xx – Success Responses

  • 200 OK: The request was processed successfully.
  • 201 Created: A new resource was successfully generated as a result of the request.
  • 202 Accepted: The request has been received but hasn’t been completed yet.
  • 204 No Content: The request was successful, but there’s no data to return.
  • 206 Partial Content: The server is sending only a part of the requested file.

🔄 3xx – Redirections

  • 301 Moved Permanently: The resource has been relocated to another URL.
  • 302 Found: The requested content is temporarily available at a different location.
  • 304 Not Modified: The content hasn’t changed since the last request.
  • 307 Temporary Redirect: The resource has a new location but will return to the original URL later.
  • 308 Permanent Redirect: Similar to 301, but ensures that the request method (GET, POST) remains unchanged.

🚫 4xx – Client Errors

  • 400 Bad Request: The request is incorrect or malformed.
  • 401 Unauthorized: Authentication is required but missing or incorrect.
  • 403 Forbidden: The server denies access to the resource.
  • 404 Not Found: The requested content isn’t available.
  • 405 Method Not Allowed: The method used is not permitted for this resource.
  • 408 Request Timeout: The server didn’t get a response in time.
  • 410 Gone: The content has been removed permanently.

  5xx – Server Errors

  • 500 Internal Server Error: A generic error indicating an issue on the server.
  • 502 Bad Gateway: The server received an invalid response from another server.
  • 503 Service Unavailable: The server is overloaded or undergoing maintenance.
  • 504 Gateway Timeout: The server took too long to get a response from another server.
  • 505 HTTP Version Not Supported: The HTTP version used in the request is unsupported.

Conclusion

Understanding these codes helps developers troubleshoot website issues effectively. Handling errors properly ensures a better user experience and smoother online interactions.