Krill KitsKrill Kits// A swarm of small, sharp tools for letters, numbers, and units.
§ 01 / ARTICLE

HTTP Status Codes. A Field Guide.

CATEGORY NETWORKREAD 6 MINPUBLISHED APR 21, 2026

Three digits, five classes, ~75 codes you might actually see. The leading digit tells you who’s responsible — informational, success, redirect, your fault, our fault. Once you know the class, you know what to do next.

The five classes, in one table

  • 1xx Informational — Provisional. The server got your request and is continuing. Rarely seen at the application level.
  • 2xx Success — Worked. Process the body and move on.
  • 3xx Redirection — Resource is elsewhere. Follow the Location header.
  • 4xx Client error — Your request is wrong somehow. Don’t retry without changing it.
  • 5xx Server error — Server’s problem. Often transient — retry with exponential backoff.

2xx — the wins

  • 200 OK — Generic success. The default.
  • 201 Created — POST succeeded and created a new resource. Should include a Location header pointing at the new thing.
  • 204 No Content — Success, but the body is empty. Common for DELETE responses.
  • 206 Partial Content — Range request worked. Used by video streaming, resumable downloads.

3xx — “look elsewhere”

  • 301 Moved Permanently vs 308 Permanent Redirect — Both say “use this URL forever.” 308 explicitly preserves the HTTP method; 301 historically may rewrite POST → GET. Prefer 308 for APIs.
  • 302 Found vs 307 Temporary Redirect — Same distinction, but for “use this URL for now.” Prefer 307.
  • 304 Not Modified — Cached version is still fresh. Server sent no body — your client should reuse what it has.
// TRY THE TOOL
SEARCH ALL CODES.

Searchable reference for every status code with class filters and Cloudflare-specific 5xx range.

OPEN →

4xx — your request is the problem

  • 400 Bad Request — Server can’t parse what you sent. Usually JSON syntax error or missing required field.
  • 401 Unauthorized — No credentials or invalid credentials. Misnamed; it means “not authenticated.”
  • 403 Forbidden — You’re authenticated, but not allowed.
  • 404 Not Found — Resource doesn’t exist (or the server isn’t admitting it does).
  • 405 Method Not Allowed — Resource exists, but not for that HTTP method (e.g. POST to a GET-only endpoint).
  • 409 Conflict — Edit conflict, duplicate entry, version mismatch.
  • 422 Unprocessable Content — Syntactically fine but semantically wrong. APIs use this for validation errors (missing fields, out-of-range values).
  • 429 Too Many Requests — Rate limited. Honor the Retry-After header. Backoff exponentially if it’s missing.

5xx — server’s problem

  • 500 Internal Server Error — Generic crash. Logs are your friend.
  • 502 Bad Gateway — Upstream returned malformed response. Origin probably crashed.
  • 503 Service Unavailable — Server overloaded or down for maintenance. Should include Retry-After.
  • 504 Gateway Timeout — Upstream took too long. Origin slow or unreachable.
  • 520–526 — Cloudflare-specific. 521 = origin down. 522 = TCP timeout. 525 = TLS handshake failed. Check origin, not Cloudflare.

What to do with each class

  • 2xx — Process the body.
  • 3xx — Follow Location header. Most clients do this automatically.
  • 4xx — Fix the request. Don’t retry without changes.
  • 429 — Wait for Retry-After, then retry.
  • 5xx — Retry with exponential backoff (1s, 2s, 4s, 8s…), give up after a few attempts.
§ 02 / FAQ

Questions. Answered.

What’s the difference between 401 and 403?+
401 means "you didn’t authenticate" — no token, expired credentials, etc. 403 means "you authenticated but you’re not allowed." Both refuse the request, but for different reasons. Confusingly, the names suggest the opposite (401 sounds like permissions, 403 sounds like identity).
When should I use 301 vs 308?+
Both are permanent redirects. 301 is the older code; some clients silently rewrite POST/PUT requests to GET on a 301 (legacy behavior). 308 is the modern equivalent that explicitly preserves the HTTP method. For new APIs, prefer 308. For browser-facing redirects, either works.
Is a 502 my fault?+
Usually not your fault as the user — a 502 means an upstream server returned something invalid. As a developer it usually means your origin server crashed, returned malformed bytes, or the connection between the proxy and origin broke. Check origin logs first, not the load balancer.
What’s 418?+
I’m a teapot. RFC 2324, an April Fools’ joke from 1998. Some APIs use it as a rate-limit signal or "cute" error. Not in the standard HTTP set, but widely supported because removing it became a meme.
§ 03 / TOOLS

Related calculators.

§ 04 / READING

Keep reading.