HTTP Status Codes

The 3-digit integer codes (1xx to 5xx) returned by a server to indicate the outcome of an HTTP request.

Internet3 min readConcept 11 of 35

What it is

**HTTP Status Codes** are 3-digit integers returned by the server in the response Start Line. They are grouped into 5 classes: **1xx** (Informational), **2xx** (Success), **3xx** (Redirection), **4xx** (Client Error), and **5xx** (Server Error).

Why it matters

They tell you exactly how to handle a response in the UI (e.g., showing a green checkmark for 200, redirecting the user on 301, showing a validation error on 400, or a 'try again later' message on 500). They also affect SEO (301 permanent vs 302 temporary redirects).

How it works

The first digit of the status code defines its class of response. The browser's network stack parses this number immediately upon receiving the start line and reacts automatically to certain codes (like following a Location header on a 301).

Try it

Use the Status Code Simulator below. Trigger different codes and see how the 'Blame Meter' shifts depending on the error class.

Trigger Response

The Blame Meter

2xx
3xx
4xx
5xx
Tap a status code to see who gets the blame.

Check yourself

Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.

  1. 1Which class of HTTP status codes indicates that the client made a mistake, such as requesting a page that doesn't exist?
  2. 2What is the primary difference between a 401 Unauthorized and a 403 Forbidden?
  3. 3If your backend server crashes due to an unhandled exception while processing a request, which status code should it return?

Remember this

  • 2xx = Success (e.g., 200 OK, 201 Created).
  • 3xx = Redirection (e.g., 301 Moved Permanently, 302 Found).
  • 4xx = Client Error (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found).
  • 5xx = Server Error (e.g., 500 Internal Server Error, 502 Bad Gateway).

Done with this concept?

Mark it complete to track your progress. No login needed.