The complete HTTP status code reference

Every HTTP response carries a 3-digit status code. The first digit indicates the category (1=info, 2=success, 3=redirect, 4=client error, 5=server error). Here are all the codes you'll see in real traffic, plus what each means.

1xx — Informational

CodeStatusMeaning
100ContinueInitial part of request received, continue. Used with Expect: 100-continue.
101Switching ProtocolsServer agrees to switch protocols (HTTP→WebSocket upgrade).
103Early HintsPreload hints sent before final response. Used by Cloudflare for performance.

2xx — Success

CodeStatusMeaning
200OKStandard success. Most common response.
201CreatedResource created. Usually with a Location header pointing to the new resource.
202AcceptedAccepted for processing but not complete. Async operations.
204No ContentSuccess, nothing to return. Common for DELETE and PUT.
206Partial ContentRange request fulfilled. Video streaming, resumable downloads.

3xx — Redirection

CodeStatusWhen to use
301Moved PermanentlyResource has moved forever. Search engines update their index. Cacheable.
302FoundTemporary redirect. Historically browsers GET-ify POSTs after this.
303See OtherAlways GET the new URL. Used after POST to redirect to the result.
304Not ModifiedConditional GET — your cached copy is still valid. No body returned.
307Temporary RedirectSame as 302 but explicitly preserves method (POST stays POST).
308Permanent RedirectSame as 301 but explicitly preserves method.
301 vs 302 in practice

Use 301 when the URL has permanently changed (renamed pages, new domain). Search engines transfer ranking signals. Use 302 for temporary redirects (A/B tests, maintenance, login redirects). Picking the wrong one can hurt SEO badly.

4xx — Client Error

CodeStatusMeaning
400Bad RequestGeneric client error — malformed JSON, missing field.
401UnauthorizedNo (or invalid) auth. Must include WWW-Authenticate header.
402Payment RequiredOriginally reserved for paid APIs. Stripe and some others use it.
403ForbiddenAuthenticated but lack permission. Don't retry with same creds.
404Not FoundResource doesn't exist. May also hide that 403 would apply.
405Method Not AllowedResource exists but you used the wrong method (GET instead of POST).
408Request TimeoutClient took too long to send the request.
409ConflictRequest conflicts with current state. Optimistic locking, version mismatch.
410GoneResource permanently removed. Stronger than 404 — search engines deindex.
413Payload Too LargeRequest body exceeds server's limit.
414URI Too LongURL exceeds the limit (usually around 8 KB).
415Unsupported Media TypeServer can't process this Content-Type.
418I'm a teapotApril Fool's joke from 1998 (RFC 2324). Some sites use it for "blocked".
422Unprocessable EntityJSON parsed but semantically wrong. Validation errors.
429Too Many RequestsRate limited. Retry-After header tells you when.
431Request Header Fields Too LargeHeaders exceed server limit. Often too-many cookies.
451Unavailable For Legal ReasonsContent blocked by court order. Named after Fahrenheit 451.

5xx — Server Error

CodeStatusMeaning
500Internal Server ErrorGeneric server error. Stack trace ate the request. Check logs.
501Not ImplementedServer doesn't recognize the method (PATCH on a server that doesn't support it).
502Bad GatewayReverse proxy got an invalid response from upstream. Backend is down.
503Service UnavailableServer overloaded or under maintenance. Retry-After may say when.
504Gateway TimeoutReverse proxy timed out waiting for upstream. Backend is slow.
507Insufficient StorageServer is out of disk (WebDAV).
511Network Authentication RequiredCaptive portal — sign in to Wi-Fi to continue.
520-527Cloudflare codes520=Unknown, 521=Web Server Down, 522=Timeout, 523=Origin Unreachable, 524=Timeout, 525=SSL Handshake, 526=Invalid SSL.

Quick reference: when to return which code

ScenarioCode
GET request worked200
POST created a new resource201 (with Location header)
DELETE succeeded204 or 200
User not logged in401
User logged in but lacks permission403
JSON validation failed422 (or 400)
Rate limit hit429 (with Retry-After)
Permanent URL change301
Temporary URL change (login flow, A/B test)302 or 307
Database connection failed503
Unhandled exception in your code500