Every HTTP response starts with a three-digit number, and that number is the server telling you, in the shortest possible form, what happened to your request. Most of the time you never see it: the page loads and the browser moves on. The number only becomes visible when something is wrong, which is exactly when you need to know what it means.
Status codes are not just diagnostics, though. They are instructions. A 301 tells a search engine to move its index entry permanently; a 429 tells a client exactly how to back off; a 503 tells a crawler to come back later instead of dropping your page. Returning the wrong code is one of the quietest ways to lose traffic, because nothing visibly breaks. This guide walks through every class, the codes you will actually meet, and how to check what a URL really returns.
Why Status Codes Matter
Four audiences read your status codes, and each one acts on them differently:
- Browsers. They decide whether to follow a redirect, whether to re-use a cached copy, and whether to re-submit a form body.
- Search engines. A code decides whether a URL is indexed, merged with another, retried later, or dropped. Serving a friendly "not found" page with a
200is the classic mistake here: the crawler is told the page exists and keeps it in the index. - API clients. Well-written clients branch on the code. A
429or503is worth retrying; a400never is, because retrying a malformed request just produces the same error. - Your own monitoring. Error rates and alerts are almost always built on status codes, so a service that returns
200with an error in the body is invisible to its own dashboards.
The Five Classes
The first digit tells you who is responsible and what to do next. If you remember nothing else, remember this table.
| Class | Meaning | What the client should do |
|---|---|---|
1xx | Informational: the request was received, processing continues | Wait; you will rarely see these |
2xx | Success: the request was received, understood and accepted | Use the response |
3xx | Redirection: the resource lives somewhere else | Follow the Location header |
4xx | Client error: the request was wrong | Fix the request; do not blindly retry |
5xx | Server error: the request was fine, the server failed | Retry with backoff |
The 4xx and 5xx split is the one that matters most in practice, because it answers the only question that counts during an incident: is this mine to fix, or theirs?
The Codes You Will Actually Meet
There are dozens of registered codes, but a working day involves maybe fifteen. The success codes are the simplest. 200 OK is the ordinary answer. 201 Created is the correct reply to a POST that made something, and it should carry a Location header pointing at the new resource. 204 No Content says the request succeeded and there is deliberately nothing to send back, which is the right answer to a DELETE. 206 Partial Content is what makes video seeking and resumable downloads work.
Redirects: 301, 302, 307 and 308
Redirects cause more SEO damage than any other class, almost always because the permanent and temporary forms get swapped.
301 Moved Permanently— the URL has changed for good. Search engines transfer ranking signals to the new address and eventually replace the old one in their index. Use it for domain migrations, HTTP to HTTPS, and removing or addingwww.302 Found— temporary. The old URL stays indexed because you have said it is coming back. Use it for A/B tests, short maintenance windows and geo-routing you intend to reverse.307 Temporary Redirect— like302, but the method and body are guaranteed to be preserved. APOSTredirected with307arrives as aPOST; historically some clients turned a redirectedPOSTinto aGET.308 Permanent Redirect— the permanent counterpart of307: same caching semantics as301, with the method preserved.304 Not Modified— not really a redirect. It answers a conditional request and means "your cached copy is still good", which is why a well-configured site transfers far less data than its page weight suggests.
Two rules: never chain redirects where one hop would do, because each hop costs latency and crawl budget, and never redirect every missing page to your homepage. That second one looks tidy and tells both users and crawlers something false.
Client Errors: 400, 401, 403, 404 and 429
The 4xx family says the request itself was the problem. The distinctions are worth getting right, because clients behave differently on each.
400 Bad Request— malformed syntax: broken JSON, a missing required field, a parameter that cannot be parsed. Never retryable as sent.401 Unauthorized— misnamed; it means unauthenticated. No credentials, or credentials the server could not verify. It should include aWWW-Authenticateheader.403 Forbidden— the server knows who you are and you still may not do this. Re-authenticating will not help.404 Not Found— nothing exists at this URL. The server does not say whether it ever did.405 Method Not Allowed— the URL exists but not for this verb. Include anAllowheader listing the ones that work.409 Conflict— the request collides with the current state, such as a duplicate key or a stale version.410 Gone— the resource existed and was deliberately removed. Search engines drop a410faster than a404, so it is the better choice when you have retired content on purpose.422 Unprocessable Content— the syntax parsed but the values fail validation. Useful when you want to separate "I cannot read this" from "I read it and it is wrong".429 Too Many Requests— you have exceeded a rate limit. Always pair it with aRetry-Afterheader; without one, clients retry immediately and make the overload worse.
Server Errors: 500, 502, 503 and 504
A 5xx means your request was reasonable and the server failed anyway. The four common ones point at different layers, which makes them genuinely useful during an incident.
500 Internal Server Error— an unhandled exception in the application. The generic catch-all, and the one to look for in your logs first.502 Bad Gateway— a proxy or load balancer got an invalid or empty response from upstream. Usually the application behind the proxy crashed or was not listening.503 Service Unavailable— the server is overloaded or in maintenance. This is the one code in the family you should return deliberately, with aRetry-Afterheader, during planned downtime: crawlers keep the page and come back.504 Gateway Timeout— the proxy waited for upstream and gave up. Points at a slow dependency rather than a crash.
During an outage, the difference between 502 and 504 tells you whether your application died or merely got slow, which is often the fastest clue available.
Status Codes and SEO
Search engines treat the status code as the authoritative statement about a URL, and they trust it over anything in the page body. Four consequences follow:
- Soft 404s waste crawl budget. A "page not found" message served with
200keeps a dead URL indexed and competing with your real pages. Return a real404or410. - Use
301for permanent moves. A302on a genuine move leaves the old URL indexed and splits signals between two addresses. - Keep redirect chains short. Every hop adds latency and crawlers follow only a limited number before giving up. Point the old URL directly at the final destination.
- Return
503during maintenance. A503withRetry-Aftertells a crawler to come back. A timeout or a500looks like a broken site.
Redirects also interact with HTTPS. If your http:// to https:// redirect is in place but the certificate is invalid or expired, visitors get a browser warning before the redirect matters, so it is worth confirming the certificate with the SSL Certificate Checker at the same time.
How to Check a Status Code
Your browser hides the code on a successful load, so you have to ask for it explicitly. Three reliable ways:
- The browser's network panel. Open developer tools, reload, and read the Status column. This shows the full redirect chain, which a single number cannot.
curl -I https://example.com. AHEADrequest prints the status line and headers without downloading the body. Add-Lto follow redirects and see each hop.- A reference you can search. When you have the number and need the meaning, obligations and typical causes, our HTTP Status Codes reference lists every code with what to do about it.
Two things to check beyond the number itself. First, test the exact URL a user would hit, including or excluding the trailing slash, since those frequently resolve differently. Second, if the response is a 429, read the Retry-After value and work out whether your client's backoff actually respects it; the Rate Limit Calculator turns a limit into concrete request intervals.
Common Mistakes to Avoid
- Returning
200with an error in the body. Monitoring, caches, crawlers and clients all read the code, not your JSON. This is the single most consequential mistake in the list. - Using
302for a permanent move. Ranking signals stay on the old URL, sometimes for months. - Redirecting all 404s to the homepage. It hides broken links from you and produces soft 404s for crawlers.
403where401belongs. A client that gets403will not try to authenticate, because403says authentication is not the issue.429with noRetry-After. Clients then guess, usually by retrying at once, which is precisely the behaviour the limit exists to prevent.- Letting maintenance return a timeout. Return
503withRetry-Afterso you keep your index entries. - Long redirect chains after a migration. Each migration adds a hop; collapse them to one when you next touch the rules.
Check Your Own Status Codes
Status codes are the cheapest diagnostic on the web: one number, no authentication, and an unambiguous answer about whether a URL works, moved, or failed. Start by checking what your own important pages return, confirm that your redirects are permanent where they should be and temporary where they should be, and make sure every error path returns a code that matches what actually happened.
Related tools and guides:
- HTTP Status Codes - searchable reference for every response code.
- Rate Limit Calculator - turn a limit into safe request intervals and a
Retry-After. - DNS Lookup - confirm a domain resolves before you debug its responses.
- SSL Certificate Checker - verify the certificate behind your HTTPS redirect.
- 301 vs 302 Redirects: Which to Use and What SEO Sees - which redirect to use and what each one does to your rankings.
- 404 vs 410: What Each One Tells Google About a Dead Page - what each code tells Google about a page you have deleted.
Frequently Asked Questions
Why does using a 302 for a permanent move cost me rankings?⌄
Because a 302 tells search engines the old URL is coming back, so they keep it indexed and leave the ranking signals on it. Your new URL then competes with the old one instead of inheriting from it, and the split can persist for months. A 301 is the instruction to move the index entry and transfer those signals, which is what a permanent move actually needs.
How many redirect hops is too many?⌄
One is the target and two is tolerable; beyond that you are paying latency on every visit and spending crawl budget that could have gone on real pages. Crawlers follow only a limited number of hops before giving up, so a chain built up over several migrations can leave the final page unreachable. When you next touch the rules, point each old URL straight at its final destination.
What should an API return when a client hits a rate limit?⌄
A 429 Too Many Requests, with a Retry-After header giving the number of seconds to wait. Returning 403 or 500 instead leaves clients with no way to behave correctly, so they retry immediately and deepen the overload. The Rate Limit Calculator works out a sensible interval and Retry-After value for you.
How do I tell whether an outage is my application or a slow dependency?⌄
Read the code your proxy returns. A 502 means it got an invalid or empty response from upstream, so the application behind it crashed or was not listening. A 504 means it waited for upstream and gave up, which points at something downstream being slow rather than dead. That one digit is often the fastest clue available during an incident.
Why is 401 called Unauthorized when it means unauthenticated?⌄
It is a naming accident in the original specification that was never corrected. In practice 401 means the request carried no credentials or credentials the server could not verify, and it should include a WWW-Authenticate header. 403 Forbidden is the code for a request that was authenticated successfully but is still not permitted.
How do I see the status code of a page in my browser?⌄
Open developer tools, switch to the Network panel, reload the page, and read the Status column for the top-level document. That view also shows every hop in a redirect chain, which a single status code cannot. From a terminal, curl -I prints the status line without downloading the body, and adding -L follows redirects.
15+ years of hands-on experience in web development and security. Focused on practical web security: keeping websites secure, reliable and easy to troubleshoot. BuildToolForge exists to make these checks free, private and understandable. Tools run in your browser wherever possible, and nothing you enter into a tool is stored.
How we write our guides: Every guide is written from hands-on experience, checked against the official standards, and tested with our own tools on real domains. We update guides when standards or tools change. Found a mistake? Email contact@buildtoolforge.com.