🛠️ Developer & Web

HTTP Status Codes

Every HTTP status code, explained in plain English.

  • 60status codes listed
  • 5classes 1xx–5xx
  • Searchby number, name or meaning
  • Filterone class at a time

How to use the HTTP Status Codes

  1. 1

    Type a number or a word

    404, 42 (all codes starting 42), redirect, cache or webdav all work.

  2. 2

    Narrow by class

    Use the category menu to show only 1xx, 2xx, 3xx, 4xx or 5xx.

  3. 3

    Read the explanation

    Each entry has the official name and a plain-English meaning with typical use.

  4. 4

    Apply it

    Use the right code in your API, check a redirect, or understand an error from a server or proxy.

Features

Standard and WebDAV

Everything from 100 Continue to 511 Network Authentication Required.

Search descriptions

Words match the meaning text too, so “redirect” finds 302, 303, 307 and 308.

Prefix search

Typing 5 or 50 lists matching codes instantly.

Colour by class

Success, redirect, client and server errors are easy to tell apart.

Current names

Uses today’s names such as 413 Content Too Large and 422 Unprocessable Content.

Instant

The list is built into the page, so searching needs no network.

Who uses it — and for what

API designers

Choose between 400 and 422, or 401 and 403.

SEO specialists

Understand redirects, 404s and 410s found by crawlers.

Ops and support

Decode 502, 503 and 504 errors during incidents.

Students

Learn the HTTP response model with plain explanations.

The five classes

  • 1xx Informational — the request was received and is continuing.
  • 2xx Success — the request worked (200 OK, 201 Created, 204 No Content).
  • 3xx Redirection — the client must go elsewhere (301 permanent, 302/307 temporary, 304 use your cached copy).
  • 4xx Client errors — the request was wrong: bad data (400), not signed in (401), not allowed (403), not found (404), too many requests (429).
  • 5xx Server errors — the server failed: a bug (500), a bad upstream (502), overloaded or down (503) or too slow (504).

Codes that matter for SEO

Search engines treat status codes as signals. Use 301 (or 308) when a page moves permanently so ranking passes to the new URL; 302/307 only for temporary moves. Return a real 404 or 410 Gone for deleted pages instead of redirecting everything to the home page (a “soft 404”). Frequent 5xx errors make crawlers slow down, and a 503 with Retry-After is the right response during planned maintenance.

Choosing the right code for an API

SituationCodeWhy
GET found the resource200Body contains it
POST created something201Add a Location header with its URL
Job queued for later202Return a status URL to poll
DELETE succeeded, nothing to return204No body allowed
JSON cannot be parsed400The request itself is malformed
JSON is valid but fails validation422Syntax fine, content wrong
No or invalid token401Send a WWW-Authenticate header
Valid token, not allowed403Or 404 if you do not want to reveal the resource exists
Duplicate email or version clash409Conflict with current state
Rate limit429Include Retry-After
Unhandled exception500Log details server-side, return a safe message

Consistency matters more than perfection: document which codes your API returns and include a machine-readable error body. RFC 9457 (“Problem Details for HTTP APIs”) defines a standard JSON format, application/problem+json, with fields such as type, title, status and detail.

Redirects compared

CodePermanent?Method on followTypical use
301YesBrowsers may change POST to GETMoved pages, http → https, domain changes
302NoBrowsers may change POST to GETShort-term moves, login redirects
303NoAlways GETAfter a form POST (“Post/Redirect/Get”)
307NoSame method and bodyTemporary moves of API endpoints
308YesSame method and bodyPermanent moves of API endpoints

Browsers cache 301 and 308 aggressively, sometimes indefinitely, so test with a temporary code first if you are unsure. 304 Not Modified is technically a 3xx but is not a redirect: it tells the client its cached copy, validated with an ETag or Last-Modified date, is still good.

Where error codes really come from

Not every status you see was produced by your application. A CDN, load balancer, reverse proxy or the browser itself may answer first:

  • 502 — the proxy reached your app but got an invalid response, or the connection was refused because the app is down.
  • 504 — the proxy waited and gave up; the app may be stuck on a slow database query.
  • 413 — often the proxy’s upload limit, such as nginx’s client_max_body_size, before your app sees the request.
  • 499 and 520–527 are non-standard codes used by nginx logs and some CDNs; they are not in this list because they are not part of the HTTP standard.
  • A CORS failure is not a status code at all — the browser hides the response from your script even if the server returned 200.

To fix the server side of these, the nginx config generator and .htaccess generator show the relevant directives.

Worked examples

Searching “redirect”

Four codes appear: 302, 303, 307 and 308, because their descriptions contain the word. 301 is not listed for that word — search “moved” or “permanent” to see it — which shows that the search reads names and descriptions literally.

Searching “42”

Codes beginning with 42 appear: 421, 422, 423, 424, 425, 426, 428 and 429. Prefix search is handy when you remember only the start of a code from a log line.

Searching “webdav”

Six codes come from the WebDAV extensions: 207, 208, 423, 424, 507 and 508. You will rarely send these from a normal REST API, though 207 is sometimes used for batch responses.

Pro tips

  • Return 404 or 410 for removed pages; redirecting everything to the home page is treated as a soft 404.
  • Never return 200 with an error message in the body — clients and monitoring will think the call worked.
  • Check a URL’s real status with curl -I https://example.com/page.

Glossary

Status line
The first line of an HTTP response, such as HTTP/1.1 404 Not Found.
Reason phrase
The text after the number; clients must rely on the number, not the phrase.
Soft 404
A missing page that returns 200 instead of 404, confusing search engines.
Retry-After
A header telling clients how long to wait before trying again (429, 503).

Frequently asked questions

What is the difference between 401 and 403?

401 means you are not authenticated; 403 means you are authenticated but not allowed.

301 vs 302?

301 is a permanent move that passes SEO value; 302 is temporary.

What causes a 502 Bad Gateway?

A proxy or load balancer got an invalid response from the app server — often the app crashed or isn’t running.

Which RFC defines HTTP status codes today?

RFC 9110 (HTTP Semantics, 2022) defines the core codes; others such as 429 come from separate RFCs, and IANA keeps the official registry.

Is 418 I’m a teapot a real code?

It began as an April Fools’ RFC and is not used for real errors, but it is widely recognised and reserved so it will not be reassigned.

Should a validation error be 400 or 422?

Both are common. Many APIs use 400 for unparseable requests and 422 for well-formed requests whose data fails validation.

Found it useful? Share the HTTP Status Codes:

Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)