Skip to main content

2026-02-25

7 min

By Formatho Editorial

Understanding HTTP Status Codes Every Developer Should Know

HTTPAPIWeb Dev
Calendar and clock representing scheduled tasks and cron jobs

The five classes

Status codes answer one question: who is at fault and what should the client do next? 1xx = in progress, 2xx = success, 3xx = go elsewhere, 4xx = client's fault, 5xx = server's fault. Restful APIs and crawlers both depend on you answering honestly.

The codes that matter daily

CodeMeaningNotes
200OKGET/PUT/PATCH success
201Createdinclude a Location header
204No contentDELETE success; must have empty body
301 / 308Moved permanently308 preserves method; 301 may re-POST as GET
302 / 307Moved temporarilyuse for flows that will revert
304Not modifiedwith ETag/If-None-Match; saves the full transfer
400 / 422Bad request / unprocessable400 = malformed; 422 = well-formed but invalid
401 / 403Unauthenticated / unauthorized401 = log in; 403 = logged in, still denied
404Not foundalso the honest answer for "exists but none of your business" — 403 leaks existence
409Conflictconcurrent update / duplicate key
429Too many requestssend Retry-After
500 / 502 / 503 / 504Server errorsbug / bad gateway / overloaded / timeout

Where APIs go wrong

  • Everything is 200 with {"error": ...} in the body — breaks retry logic, monitoring, and every HTTP client's assumptions.
  • 500 for validation errors — a client-fixable problem paging an on-call engineer.
  • Redirect chains — 301 then 302 then 301: each hop costs a round trip; consolidate, and never redirect POST without 307/308.

SEO angles

Google treats 4xx/5xx honestly: a 404 drops the URL from index (fine for removed pages), but a soft-404 — a "200 OK" page saying "not found" — wastes crawl budget and confuses signals. 301 passes equity; 302 tells Google the target is temporary. 503 with Retry-After is the correct "down for maintenance" signal; repeated 500s deindex content.

Look up any code with response-class explanations in the HTTP Status Codes reference.

Formatho Editorial — written and maintained by the team behind formatho.com, a library of free, privacy-first developer tools that run entirely in your browser. Every guide is tested against the tools it describes. Corrections and suggestions: github.com/formatho.