HTTP Status Codes Explained

Run a Speed Test

Every time your browser asks a server for a page, the server answers with a three-digit number before it sends anything else. That number — the HTTP status code — says whether the request worked, was redirected, or failed, and whose fault the failure was. Learn to read the first digit and most of the web's error messages stop being mysterious.

The First Digit Tells You Almost Everything

HTTP status codes are deliberately structured so that the leading digit carries the headline and the remaining two digits add detail. There are five classes, and knowing them is enough to triage most problems:

ClassMeaningWhose side
1xxInformational — request received, still processing
2xxSuccess — the request worked
3xxRedirection — look elsewhere to finish the request
4xxClient error — the request was wrongClient
5xxServer error — the server failed to fulfil a valid requestServer

The single most useful habit is distinguishing 4xx from 5xx. A 4xx says you (the client) sent something the server could not accept — a bad URL, missing credentials, a malformed request. A 5xx says the request was fine but the server broke trying to handle it. That one distinction tells you immediately whether to fix the request or escalate to whoever runs the server. These codes travel in the HTTP response over either HTTP or HTTPS.

1xx — Informational

These are interim responses; you rarely see them as an end user because the browser handles them quietly.

  • 100 Continue — the server is willing to accept the request body; the client may proceed to send it. Used when a client asks permission before uploading a large payload.
  • 101 Switching Protocols — the server agrees to change protocols, most commonly the upgrade from HTTP to a WebSocket connection.
  • 103 Early Hints — lets the server send preliminary headers (such as resources to preload) before the final response is ready, shaving time off page loads.

2xx — Success

  • 200 OK — the default success. The request worked and the response body contains what you asked for.
  • 201 Created — a new resource was created, typically in response to a POST or PUT in an API.
  • 204 No Content — success, but there is intentionally no body to return (common after a delete or a form submission that needs no reply).
  • 206 Partial Content — the server is returning only part of the resource. This powers resumable downloads and video seeking, where the client requests a byte range rather than the whole file.

3xx — Redirection

A 3xx response sends the client to a different URL or tells it to use a cached copy. The differences here have real consequences for SEO and correctness:

  • 301 Moved Permanently — the resource has a new home for good. Search engines pass ranking signals to the new URL, so this is the code to use when you change a page's address permanently.
  • 302 Found / 307 Temporary Redirect — the move is temporary; keep using the original URL. Use these when redirecting for maintenance, A/B tests, or geolocation, where you do not want the old URL to lose its authority. (307 additionally guarantees the request method is preserved.)
  • 308 Permanent Redirect — like 301 but, like 307, it preserves the original HTTP method.
  • 304 Not Modified — the cached copy the browser already holds is still current, so the server sends no body. This is a cornerstone of caching and is why revisiting a page is faster than the first load.

Choosing 301 vs 302 is one of the most common technical-SEO mistakes: a temporary redirect left in place where a permanent one belongs can keep a new URL from ever inheriting the old page's search ranking.

4xx — Client Errors

The request reached the server, but something about it was unacceptable. These are the codes most visitors actually encounter:

CodeNameWhat it means
400Bad RequestThe request itself is malformed and cannot be parsed.
401UnauthorizedAuthentication is required and has not been provided (or failed).
403ForbiddenThe server understood the request but refuses it — you are not allowed, regardless of credentials.
404Not FoundNo resource exists at that URL. The server is fine; the path is not.
405Method Not AllowedThe URL exists but does not support the HTTP method used (e.g. POST to a read-only endpoint).
409ConflictThe request clashes with the current state, such as an edit collision.
410GoneThe resource was here and has been permanently removed — a stronger signal than 404.
429Too Many RequestsYou have been rate-limited; slow down and retry later.

401 and 403 are easy to confuse. 401 means "I do not know who you are — authenticate." 403 means "I know who you are, and you still cannot have this." And yes, 418 I'm a teapot is a real, if non-serious, code defined in an April Fools' specification — occasionally used to reject automated requests with a wink.

5xx — Server Errors

Here the request was valid but the server could not deliver. There is usually nothing the visitor can do but wait or report it:

  • 500 Internal Server Error — a catch-all for an unexpected server-side failure, typically an application bug or misconfiguration.
  • 502 Bad Gateway — a server acting as a proxy or gateway got an invalid response from the upstream server it relies on.
  • 503 Service Unavailable — the server is temporarily unable to handle the request — overloaded or down for maintenance. A well-behaved 503 includes a Retry-After header, and search engines treat it as "come back later" rather than "this is gone."
  • 504 Gateway Timeout — a gateway waited for an upstream server and gave up before getting a response.

502 and 504 both point at a chain of servers — a CDN, load balancer, or reverse proxy in front of the real application — rather than a single machine. They tell you the front door answered but something behind it did not.

Status Codes and Search Rankings

Because crawlers obey these codes literally, a few of them are levers for SEO rather than mere diagnostics. Serve a moved page a 301 so its ranking follows; return 410 for content you have deliberately retired so it leaves the index cleanly; and use 503 with Retry-After during planned downtime so a crawler does not interpret an outage as deletion. Misusing these — a soft 404 that returns 200, a 302 that should be 301 — quietly erodes rankings even when the pages look fine to a human visitor.

Frequently Asked Questions

What are the five classes of HTTP status codes?

1xx informational, 2xx success, 3xx redirection, 4xx client errors, and 5xx server errors. The first digit gives the broad outcome; the full code adds the specifics.

What is the difference between a 301 and a 302 redirect?

301 is permanent — search engines move ranking signals to the new URL. 302 is temporary — the original URL is kept because the move is expected to reverse. Using 302 where 301 belongs can prevent a new URL from inheriting search authority.

What does a 404 error mean?

404 Not Found means the server is working but has no resource at the requested URL — usually a mistyped or outdated link. It is a client-class (4xx) error.

What is the difference between 404 and 410?

404 means the resource is absent and might return; 410 Gone means it was permanently removed. Search engines treat 410 as a firmer instruction to drop the URL from their index.

What is a 500 internal server error?

A generic 5xx code meaning the server hit an unexpected condition — typically an application bug or misconfiguration. Unlike a 4xx error, the fix is on the server side, not the visitor's.

Related Guides

More From This Section