HTTP Status Codes Explained: Complete Guide (1xx-5xx)

Utilko Team 6 min read Developer

What Are HTTP Status Codes?

HTTP status codes are three-digit numbers that a server returns in response to every HTTP request. The first digit defines the class of response; the remaining two digits provide more specific information. Every time you load a webpage, fetch data from an API, or submit a form, at least one status code is returned behind the scenes.

Understanding these codes is essential for web developers, DevOps engineers, and anyone who works with REST APIs. They tell you instantly whether a request succeeded, why it failed, and where to look next.

The Five Classes of HTTP Status Codes

1xx — Informational

These codes indicate that the server has received the request and the client should continue. They are rarely seen in everyday browsing.

  • 100 Continue — The initial part of a request has been received; the client should proceed.
  • 101 Switching Protocols — The server is switching to a different protocol as requested (e.g., upgrading to WebSocket).
  • 103 Early Hints — Allows the browser to start preloading resources before the final response is sent.

2xx — Success

The request was received, understood, and accepted. These are the codes you want to see.

  • 200 OK — Standard success response. The resource was found and returned.
  • 201 Created — A new resource was successfully created (common after POST requests).
  • 204 No Content — The request succeeded but there is nothing to return (common for DELETE requests).
  • 206 Partial Content — Only part of the resource is returned (used for large file downloads and video streaming).

3xx — Redirection

The client must take additional action to complete the request, usually following a redirect.

  • 301 Moved Permanently — The resource has a new permanent URL. Browsers and search engines update their records.
  • 302 Found — A temporary redirect. The original URL should still be used in the future.
  • 304 Not Modified — The cached version of the resource is still valid; no body is returned.
  • 307 Temporary Redirect — Like 302 but explicitly preserves the HTTP method.
  • 308 Permanent Redirect — Like 301 but explicitly preserves the HTTP method.

4xx — Client Errors

The request contains bad syntax or cannot be fulfilled. The problem is on the client's side.

  • 400 Bad Request — The server could not understand the request due to invalid syntax.
  • 401 Unauthorized — Authentication is required. The client must log in first.
  • 403 Forbidden — The client is authenticated but does not have permission to access the resource.
  • 404 Not Found — The most famous status code. The resource does not exist at the requested URL.
  • 405 Method Not Allowed — The HTTP method (GET, POST, etc.) is not supported for this endpoint.
  • 408 Request Timeout — The server timed out waiting for the client's request.
  • 409 Conflict — The request conflicts with the current state of the resource (e.g., duplicate entry).
  • 410 Gone — Like 404, but the resource existed and was permanently removed.
  • 422 Unprocessable Entity — The syntax is valid but the server cannot process the semantic errors (common in REST APIs with validation failures).
  • 429 Too Many Requests — Rate limiting. The client has sent too many requests in a given time window.

5xx — Server Errors

The server failed to fulfil a valid request. The problem is on the server's side.

  • 500 Internal Server Error — A generic catch-all for unexpected server-side failures. Check your logs.
  • 501 Not Implemented — The server does not recognize the request method or lacks the ability to fulfil it.
  • 502 Bad Gateway — An upstream server returned an invalid response (common with proxies and load balancers).
  • 503 Service Unavailable — The server is temporarily overloaded or down for maintenance.
  • 504 Gateway Timeout — An upstream server did not respond in time.

Look Up Any Status Code Instantly

Use our free HTTP Status Codes reference tool to look up any code and get a clear explanation.

HTTP Status Codes Tool →

How to Fix the Most Common Errors

Fixing 404 Not Found

Check the URL for typos, ensure the file or route actually exists, and verify your web server routing configuration. In single-page applications, you often need to configure the server to return index.html for unknown paths.

Fixing 500 Internal Server Error

Open your server logs immediately. The error message there will identify the exact line of code or configuration that failed. Common culprits include unhandled exceptions, missing environment variables, and database connection failures.

Fixing 401 vs 403

A 401 means the user is not logged in — redirect them to the login page. A 403 means the user is logged in but lacks the necessary permissions — show them an "access denied" page instead of the login screen.

Status Codes in REST API Design

Good API design uses status codes semantically. Use 201 Created when a POST creates a resource, 204 No Content for successful DELETEs, and 422 Unprocessable Entity for validation failures rather than the catch-all 400. This makes your API predictable and easier to consume.

Conclusion

HTTP status codes are the language your server uses to communicate with clients. Knowing what each code means allows you to debug faster, design better APIs, and build more robust web applications. Bookmark our HTTP Status Codes tool as a quick reference whenever you need it.

Tools Mentioned in This Article