How the web works · Concept

HTTP status codes

The three-digit number a server sends with every response to say how the request went, from 200 (fine) to 404 (not found) and 500 (server error).

Requests and responses · updated

How it works

The first digit gives the family. 2xx means success (200 OK, 201 Created, 204 No Content). 3xx is a redirect (301 moved permanently, 302 or 307 moved for now, 304 not modified, so use the cached copy). 4xx is a problem with the request (400 bad request, 401 not signed in, 403 not allowed, 404 not found, 429 too many requests), and 5xx a problem on the server (500 internal error, 502 bad gateway, 503 unavailable, 504 gateway timeout).

The right code matters beyond tidiness. Search engines follow a 301 and pass rankings to the new URL, but treat a 'page not found' message sent with a 200 status as a 'soft 404'. Monitoring, retries and caches rely on these numbers too: a 503 with a Retry-After header tells clients to come back later, while a 400 tells them that retrying the same request will not help.

More in How the web works

Requests and responses

All 20 How the web works terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.