The five HTTP status code classes
What 1xx, 2xx, 3xx, 4xx and 5xx mean, with the common codes in each class and when servers send them.
How the classes work
The first digit of a status code defines its class, so a client can react sensibly even to a code it has never seen. 1xx is informational, 2xx means success, 3xx asks the client to look elsewhere, 4xx blames the request, and 5xx blames the server. The remaining two digits identify the specific code within that class.
2xx success and 3xx redirection
200 OK is the everyday success code, while 201 Created and 204 No Content cover writes and empty responses. In the 3xx range, 301 and 308 are permanent moves and 302, 303 and 307 are temporary, with 304 Not Modified powering conditional caching.
4xx client errors and 5xx server errors
4xx codes mean the client should fix something: 400 for bad syntax, 401 and 403 for auth, 404 for a missing resource, 429 for rate limiting. 5xx codes mean the server broke: 500 for an unexpected error, 502 and 504 for bad upstreams, and 503 when the service is down or overloaded.