Reference guide · http-status · Published 2026-08-15 · 4 min read
HTTP status codes explained
HTTP status codes explained: the 1xx to 5xx classes, a quick reference table of common statuses, and how status codes interact with caching and redirects.
- ·Status classes
- ·Common codes
- ·How to read one
Overview
Every HTTP response starts with a status code, a three-digit number that names the result of the request. The first digit is the class:
- 1xx Informational: the request is in progress. You rarely need to act on these.
- 2xx Success: the request worked.
- 3xx Redirection: the resource moved; the client should follow the
Locationheader. - 4xx Client error: the request was wrong from the client's side.
- 5xx Server error: the server failed to satisfy a valid request.
The codes your site will meet
| Code | Name | Meaning | What to do |
|---|---|---|---|
| 200 | OK | Success | Nothing |
| 301 | Moved Permanently | The URL moved for good | Check the target |
| 302 / 307 | Found / Temporary Redirect | Temporary move | Confirm it is temporary |
| 304 | Not Modified | Cached copy is current | Nothing |
| 400 | Bad Request | Malformed request | Fix the client payload |
| 401 | Unauthorized | Credentials missing or bad | Send correct auth |
| 403 | Forbidden | Known, but not allowed | Change the rule or permission |
| 404 | Not Found | URL does not exist | Redirect or restore |
| 410 | Gone | Was here, gone forever | Drop or 301 |
| 429 | Too Many Requests | Rate limited | Wait and retry |
| 500 | Internal Server Error | Server bug | Read the log |
| 502 | Bad Gateway | Gateway got nothing usable | Check the upstream |
| 503 | Service Unavailable | Temporarily unavailable | Wait or remove the marker |
| 504 | Gateway Timeout | Upstream took too long | Raise timeout or profile the work |
How to read one in practice
The status code is not the whole truth; the headers and body carry the next fact. In a redirect (3xx) the Location header names the target, and a Retry-After header on 429 or 503 names the wait window. A 404 or 500 only gives you the full story when you pair it with the server log for that request.
# See the status and the headers of any URL
curl -sI https://example.com/some/path
HTTP/2 200
Content-Type: text/html; charset=utf-8
Status codes in daily site work
Experience, not memory, decides which sites implement each status properly. Two genuinely common traps:
- Soft 404: the server replies 200 for a dead URL. Crawlers keep it in the index, no signal moves, and the dead page looks rankable forever.
- A 301 standing where a 404 should be: a catch-all redirect to the home page for a URL that does not exist. Users bounce, links point nowhere useful, and the extra hop adds real latency to every crawl of that path.
Which one to choose for your own site
- Dead URL with no replacement: 404 or 410 for permanent.
- Dead URL with a live replacement: 301.
- Temporarily busy or under deploy: 503 with
Retry-After. - Wrong request: 400.
- Missing login: 401; logged in but blocked: 403.
Reading a redirect chain
| Hop | Status | Location | Meaning |
|---|---|---|---|
| Request | - | /old | Start |
| 1 | 301 | /new | Permanent move, carries value |
| 2 | 200 | - | Final page |
A chain is any series of 3xx. Two or more hops are still valid, but each hop adds a request and a small risk, so keep the number small and audit them with a curl -L or a chain checker when you change a site.
Prevention with statuses
- Never return 200 for a page you do not have; real 404 or 410 code is free diagnosis.
- Pick 503 for planned downtime, and fire
Retry-Afteron it. - Log status counts by class in your analytics; a rising 4xx/5xx ratio is the early warning for a regression.