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 family. To look up the meaning of any code, use the HTTP status codes reference on this site, with search and a category filter.
How they're organized: the five families
The first digit indicates the family. The names and meanings of each code are defined in RFC 9110, the HTTP specification:
- 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 permanently. Google shows the new URL in results |
| 302 | Found | Temporary redirect. Google keeps the original URL in results |
| 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: if you move a page permanently, use 301 (or 308). If the move is temporary, use 302, 303 or 307. Google says server-side redirects are preferred, and that permanent ones make it display the new URL, while temporary ones keep the original.
The 304 is what decides whether the browser reuses what it already has stored. To understand the mechanism, read how HTTP caching works.
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 Content | 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 and 404 for not found.
- SEO: Google treats each code differently. A 404 removes the URL from the index if it was already there. A 301 makes results show the new URL. A 503 is a temporary failure, but if it persists, Google eventually drops those URLs from the index.
- Debugging: the status code is the first thing you check when something fails. The browser DevTools (Network tab) show it for every request.
From the terminal, curl prints the code with -w. For example, for a page that doesn't exist:
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/pagina-que-no-existe
404
More curl options in its command page.
Fun facts
- 418 I'm a teapot: defined in RFC 2324, an April Fools' joke from 1 April 1998 that says "I'm a teapot, I can't make coffee". IANA has it registered as unused.
- 451 Unavailable For Legal Reasons: content blocked by a legal demand. It was defined in RFC 7725, published in 2016.
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.