Every time your browser asks a server for something, it responds with an HTTP status code: a three-digit number that summarizes what happened. The most famous is the 404, but there are many more, and understanding them helps you debug websites, APIs and SEO issues. This guide explains them by category.
How they're organized: the five families
The first digit indicates the category:
- 1xx — Informational: the request was received and processing continues. You rarely see these.
- 2xx — Success: the request worked.
- 3xx — Redirection: further action is needed (usually go to another URL).
- 4xx — Client error: something's wrong with the request (you or your browser).
- 5xx — Server error: the request was fine, but the server failed.
This mental rule already tells you a lot: 4xx is the requester's fault, 5xx is the server's fault.
2xx — Success
| Code | Name | Means |
|---|---|---|
| 200 | OK | All good, here's the response |
| 201 | Created | A resource was created (typical after a POST) |
| 204 | No Content | Correct, but there's nothing to return |
| 206 | Partial Content | Partial response (downloads, streaming) |
3xx — Redirects (key for SEO)
| Code | Name | Means |
|---|---|---|
| 301 | Moved Permanently | The URL changed forever. Transfers SEO to the new one |
| 302 | Found | Temporary redirect. Does NOT transfer authority like a 301 |
| 304 | Not Modified | It hasn't changed; use your cached version |
| 307/308 | Temporary/Permanent Redirect | Like 302/301 but preserving the HTTP method |
For SEO, the difference between 301 and 302 matters a lot: if you move a page permanently, use 301 so you don't lose ranking. Using a 302 by mistake is a common error.
4xx — Client errors
| Code | Name | Means |
|---|---|---|
| 400 | Bad Request | The request is malformed |
| 401 | Unauthorized | You need to authenticate (you're not logged in) |
| 403 | Forbidden | You're identified, but you don't have permission |
| 404 | Not Found | The resource doesn't exist |
| 405 | Method Not Allowed | HTTP method not allowed here (POST where only GET is accepted) |
| 409 | Conflict | Conflict with the current state (e.g. duplicate data) |
| 422 | Unprocessable Entity | Correct syntax but invalid data (validation) |
| 429 | Too Many Requests | You've made too many requests (rate limit) |
The key difference: 401 = "I don't know who you are"; 403 = "I know who you are and you can't". And 429 is the one you'll see if an API limits you for too many calls.
5xx — Server errors
| Code | Name | Means |
|---|---|---|
| 500 | Internal Server Error | Generic server failure (a bug, an exception) |
| 502 | Bad Gateway | An intermediate server received an invalid response |
| 503 | Service Unavailable | The server is down or overloaded (sometimes, under maintenance) |
| 504 | Gateway Timeout | An intermediate server didn't receive a response in time |
If you see a 500, the problem is on the server, not your request. A 503 is usually temporary (overload or maintenance).
How they're used in practice
- REST APIs: return codes to indicate the result. A well-designed API uses 200/201 for success, 400/422 for invalid data, 401/403 for permissions, 404 for not found.
- SEO: Google treats each code differently. A 404 removes the page from the index; a 301 moves its authority; a 503 tells it "come back later".
- Debugging: the status code is the first thing you check when something fails. The browser DevTools (Network tab) show it for every request.
If you want to look up the meaning of any code instantly, you can use the HTTP status codes reference on this site.
Fun facts
- 418 I'm a teapot: a joke code (from an April Fools') that says "I'm a teapot, I can't make coffee". Some servers implement it for fun.
- 451 Unavailable For Legal Reasons: content blocked for legal reasons. The number is a nod to the novel Fahrenheit 451.
Conclusion
You don't need to memorize the hundreds of HTTP codes: by understanding the five families and the ten or fifteen most common, you cover almost everything you'll see debugging a website or an API. Remember the basic rule: 2xx good, 3xx go elsewhere, 4xx your error, 5xx server error.