Skip to content
Tutorials Center
My learning

Topics

HTML Reference ยท Characters and Codes

HTTP Status Codes

Every standard HTTP status code from RFC 9110 plus common extras such as 103, 429 and 451: what each one means and when you will actually see it.

Every HTTP response starts with a three-digit status code that tells the client how the request went. The first digit sets the class, so even a client that doesn't know a specific code can treat 499 like 400 (a client error) and 599 like 500 (a server error).

TEXT
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=utf-8
Class Meaning What the browser does
1xx Informational Interim response; the real one follows Nothing visible
2xx Success The request worked Shows the page or hands the data to your script
3xx Redirection Look somewhere else (or use your cache) Follows the Location header automatically
4xx Client error The request was wrong or not allowed Shows the error page the server sent
5xx Server error The server failed to handle a valid request Shows the error page the server sent

Try it

Look up any code. The example also shows how fetch() exposes the status: response.ok is true only for 200โ€“299.

Status code lookup

All status codes

Codes marked RFC 9110 are the core HTTP semantics standard; the others come from extension specifications but appear in the official IANA registry.

1xx: Informational

Code Name Meaning When you'll see it Defined in
100 Continue The server got the request headers and the client may send the body. Large uploads sent with Expect: 100-continue. RFC 9110
101 Switching Protocols The server agrees to change protocols. Opening a WebSocket connection. RFC 9110
102 Processing Still working on a long request (WebDAV). Rare; deprecated. RFC 2518
103 Early Hints Preliminary headers sent before the final response. Link: rel=preload hints so the browser starts fetching CSS and fonts early. RFC 8297

2xx: Success

Code Name Meaning When you'll see it Defined in
200 OK The request succeeded. Almost every normal page, image and API response. RFC 9110
201 Created A new resource was created. After a POST or PUT that creates something; often with a Location header. RFC 9110
202 Accepted The request was accepted but not finished yet. Queued background jobs. RFC 9110
203 Non-Authoritative Information The content was modified by a proxy. Rare. RFC 9110
204 No Content Success, with no body. A DELETE or a save in an API; beacon requests. RFC 9110
205 Reset Content Success; the client should reset the form or view. Rare. RFC 9110
206 Partial Content Only the requested byte range is sent. Video and audio seeking, resumable downloads (Range requests). RFC 9110
207 Multi-Status Several status codes for several resources (WebDAV). WebDAV clients. RFC 4918
208 Already Reported Members already listed earlier in a WebDAV response. WebDAV clients. RFC 5842
226 IM Used The response is the result of instance manipulations (delta encoding). Very rare. RFC 3229

3xx: Redirection

Code Name Meaning When you'll see it Defined in
300 Multiple Choices Several representations are available. Rare; browsers do not pick one automatically. RFC 9110
301 Moved Permanently The resource has a new permanent URL. Moving a site to a new domain or to HTTPS. Browsers may change POST to GET. RFC 9110
302 Found The resource is temporarily at another URL. Classic temporary redirects, such as after login. Browsers may change POST to GET. RFC 9110
303 See Other Fetch another URL with GET. The redirect after a successful form POST (Post/Redirect/Get pattern). RFC 9110
304 Not Modified The cached copy is still valid; no body is sent. Revalidation with If-None-Match or If-Modified-Since. RFC 9110
305 Use Proxy Deprecated; browsers ignore it. Never in practice. RFC 9110
306 (Unused) Reserved; no longer used. Never. RFC 9110
307 Temporary Redirect Temporarily at another URL; repeat the same method and body. Temporary redirects of POST or API requests; HSTS upgrades in browsers. RFC 9110
308 Permanent Redirect Permanently at another URL; repeat the same method and body. Permanent API moves where POST must stay POST. RFC 9110

4xx: Client errors

Code Name Meaning When you'll see it Defined in
400 Bad Request The server cannot process a malformed request. Invalid JSON, bad syntax, oversized cookies. RFC 9110
401 Unauthorized Authentication is required or failed. Missing or expired login token; comes with WWW-Authenticate. RFC 9110
402 Payment Required Reserved for future use. Some APIs use it for billing problems. RFC 9110
403 Forbidden The server understood but refuses to allow it. Logged in but not permitted; blocked directories; CSRF failures. RFC 9110
404 Not Found No resource at this URL. Broken links and mistyped URLs. RFC 9110
405 Method Not Allowed The URL exists but not for this method. Sending POST to a read-only URL; comes with an Allow header. RFC 9110
406 Not Acceptable No representation matches the Accept headers. Content negotiation failures. RFC 9110
407 Proxy Authentication Required Like 401, but for a proxy. Corporate proxies. RFC 9110
408 Request Timeout The client took too long to send the request. Idle connections; slow networks. RFC 9110
409 Conflict The request conflicts with the current state. Editing a record someone else changed; duplicate usernames. RFC 9110
410 Gone The resource was removed on purpose and will not return. Deleted content; tells search engines to drop the URL. RFC 9110
411 Length Required A Content-Length header is required. Rare. RFC 9110
412 Precondition Failed An If-โ€ฆ condition was false. Safe updates with If-Match. RFC 9110
413 Content Too Large The request body is too big. Uploading a file over the server limit. RFC 9110
414 URI Too Long The URL is longer than the server accepts. Huge GET forms or query strings. RFC 9110
415 Unsupported Media Type The body format is not supported. Sending form data to an API that expects JSON. RFC 9110
416 Range Not Satisfiable The requested byte range is outside the file. Broken resumable downloads. RFC 9110
417 Expectation Failed The Expect header cannot be met. Rare. RFC 9110
418 (Unused) Reserved because of the "I'm a teapot" April Fools' joke (RFC 2324). Easter eggs only. RFC 9110
421 Misdirected Request This server cannot answer for that host. HTTP/2 connection reuse across domains. RFC 9110
422 Unprocessable Content The syntax is fine but the data is invalid. Form and API validation errors (Laravel, Rails). RFC 9110
423 Locked The resource is locked (WebDAV). WebDAV clients. RFC 4918
424 Failed Dependency Failed because an earlier request failed (WebDAV). WebDAV clients. RFC 4918
425 Too Early The server will not process a request that might be replayed. TLS 1.3 early data (0-RTT). RFC 8470
426 Upgrade Required The client must switch to another protocol. Rare. RFC 9110
428 Precondition Required The request must be conditional. APIs that demand If-Match to prevent lost updates. RFC 6585
429 Too Many Requests The client hit a rate limit. API throttling and login attempts; often with Retry-After. RFC 6585
431 Request Header Fields Too Large Headers are too big. Too many or too large cookies. RFC 6585
451 Unavailable For Legal Reasons Blocked for legal reasons. Court orders and government censorship. RFC 7725

5xx: Server errors

Code Name Meaning When you'll see it Defined in
500 Internal Server Error A generic error on the server. Uncaught exceptions and bugs. RFC 9110
501 Not Implemented The server does not support this method at all. Unknown methods. RFC 9110
502 Bad Gateway A proxy got an invalid response from the upstream server. App server crashed behind nginx or a CDN. RFC 9110
503 Service Unavailable The server is temporarily unable to respond. Maintenance mode or overload; often with Retry-After. RFC 9110
504 Gateway Timeout A proxy did not get an answer in time. Slow backends behind a load balancer or CDN. RFC 9110
505 HTTP Version Not Supported The HTTP version is not supported. Rare. RFC 9110
506 Variant Also Negotiates Content negotiation is misconfigured. Very rare. RFC 2295
507 Insufficient Storage The server cannot store what is needed (WebDAV). Full disks on WebDAV servers. RFC 4918
508 Loop Detected An infinite loop was found (WebDAV). WebDAV clients. RFC 5842
510 Not Extended Obsolete (the extension framework was retired). Never in practice. RFC 2774
511 Network Authentication Required You must log in to the network first. Captive portals on hotel and airport Wi-Fi. RFC 6585

Usage notes

  • Pick the most specific code. 404 for missing pages, 410 for content you removed for good, 403 when the user is known but not allowed, 401 when they need to log in.
  • Error pages need the right status. A "not found" page sent with 200 OK (a soft 404) confuses search engines and monitoring. Make sure your custom error pages keep their 4xx or 5xx code.
  • Choose redirects carefully. Use 301 or 308 for permanent moves (search engines transfer the URL's ranking) and 302, 303 or 307 for temporary ones. After a form POST, redirect with 303 so a reload does not resubmit the form.
  • fetch() does not throw on 404 or 500. It only rejects on network failures. Check response.ok or response.status yourself.
  • Forms and status codes. A normal HTML form submission simply shows whatever page comes back, whatever the status. Frameworks often answer an invalid form with a 302 back to the form (for classic pages) or a 422 (for JavaScript requests).
  • Non-standard codes exist. You may see 499 (nginx: client closed the request) or Cloudflare's 520โ€“530 in logs. They are not part of HTTP and only make sense for that product.