HTTP Status Codes

All five classes, searchable — what each code means and where to start debugging.

The five families

RangeMeaningWho should act
1xxInformational — the request was received, keep goingNobody; the exchange continues
2xxSuccessNobody
3xxRedirection — the resource is elsewhereClient follows automatically
4xxClient error — the request itself is wrongThe caller must change something
5xxServer error — the request was fine, the server failedThe operator must fix something

The 4xx versus 5xx split is the most useful distinction in practice. It tells you instantly whether to look at your own code or at the service you are calling.

The codes worth knowing by heart

CodeNameWhen you will see it
200OKThe ordinary success case
301Moved PermanentlyA permanent URL change; search engines transfer ranking
302 / 307Found / Temporary RedirectTemporary routing; 307 preserves the HTTP method
304Not ModifiedConditional request hit the cache
400Bad RequestMalformed syntax or failed validation
401 / 403Unauthenticated / ForbiddenNot logged in, versus logged in but not allowed
404Not FoundThe resource does not exist, or is hidden behind a 404 on purpose
429Too Many RequestsRate limiting — back off and retry with a delay
500Internal Server ErrorAn unhandled exception on the server
502 / 503Bad Gateway / UnavailableAn upstream is broken or deliberately down for maintenance

301 versus 302 — the one that costs SEO

A 301 is a permanent move: browsers cache it aggressively and search engines consolidate the old URL into the new one. A 302 is temporary and does not transfer ranking. Using a 302 for a permanent restructure, or a 301 for a temporary experiment, is a classic and expensive mix-up. If the redirect is expected to become permanent, use 301.

Reading a status code in context

The same code can mean different things. A 404 is a bug on your own site and a normal signal from a well-behaved API that asked for a record that does not exist. A 403 from a scraper usually means detection, not a permission problem. Always pair the code with the endpoint and the payload before drawing conclusions.

401 and 403 are routinely swapped

401 is named "Unauthorized" but what it actually means is unauthenticated: the server does not know who you are. 403 means it does know, and you still may not proceed. Getting this backwards changes client behaviour — a 401 tells the caller to retry with credentials that will never help, while a 403 hides the fact that logging in would fix the problem.

The headers settle it. A 401 should carry WWW-Authenticate naming the expected scheme; a 403 must not, because fresh credentials would not change the outcome.

200 with an error inside

An API that answers 200 OK with {"success": false, "error": "not found"} breaks three things at once: caches store the failure as a success, dashboards count it as healthy traffic, and client retry logic has nothing to trigger on. Let the status code describe the outcome and the body describe the detail.

The legitimate exception is a batch endpoint where individual items fail while the request as a whole succeeded — there a 200 with per-item results is correct, provided the response says so explicitly rather than leaving the caller to guess.

Related tools

DNS propagation check User-agent parser JSON formatter

FAQ

How many classes of HTTP status codes are there?
Five: 1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error. Common ones — 200 OK, 301 permanent redirect, 404 not found, 500 server error — belong to these classes.
What's the difference between 404 and 502?
404 means the server explicitly says “this resource does not exist” — a request-path problem on the client side. 502 means the service behind a gateway/reverse proxy is down or unresponsive — a server-side problem; check the backend process and upstream logs.
Is any data uploaded?
No. Searching and browsing happen entirely in your browser.