Skip to content
We areTOP 1%

What do HTTP status codes mean? Explain the 1xx to 5xx classes.

EasyConceptDNS, HTTP & HTTPS
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

A status code is the three-digit number in every HTTP response that tells the client what happened. The first digit gives the class.

ClassMeaningCommon codes
1xxinformational100 Continue, 101 Switching Protocols
2xxsuccess200 OK, 201 Created, 204 No Content
3xxredirection301 Moved Permanently, 302 Found, 304 Not Modified
4xxclient error400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
5xxserver error500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable
  • 401 vs 403: 401 means the client is not authenticated, so it should log in and retry; 403 means it is authenticated but not allowed.
  • A 4xx code means the client must fix the request; a 5xx code means the server failed on a valid request, so retrying later may succeed.

Example:

GET /profile   (no login token)       ->  401 Unauthorized
GET /admin     (token of a student)   ->  403 Forbidden
GET /old-page                         ->  301 Moved Permanently, Location: /new-page
GET /no-such-page                     ->  404 Not Found
GET /orders    (database is down)     ->  500 Internal Server Error

More in DNS, HTTP & HTTPS

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account