handy.moe

All tools / Debug tools

A professor reading a book

HTTP status codes

What each code means, what usually causes it, and what to do about it. Names follow RFC 9110.

This page runs in your browser and makes no requests.

Jump to: 1xx · 2xx · 3xx · 4xx · 5xx · Non-standard codes

1xx: Informational

The request was received and work continues.

100 Continue

The server got the request headers and the client should go ahead and send the body.

Common causes. A client sent Expect: 100-continue before a large upload. Normally invisible: libraries handle it.

What to do. Nothing to fix. If an upload hangs, check that the client waits for the 100 before sending, or turn the Expect header off.

RFC 9110 §15.2.1

101 Switching Protocols

The server agrees to change protocol, as the client asked in the Upgrade header.

Common causes. WebSocket handshakes (Upgrade: websocket) and HTTP/2 over cleartext upgrades.

What to do. If a WebSocket connection fails, look for proxies that strip Upgrade and Connection headers.

RFC 9110 §15.2.2

102 Processing

WebDAV: the server has accepted the request but has no result yet.

Common causes. Long WebDAV operations on many resources.

What to do. Deprecated in practice. Treat as 'keep waiting'.

RFC 2518 (obsolete)

103 Early Hints

The server sends headers early (usually Link: rel=preload) so the browser can start fetching assets while the real response is prepared.

Common causes. Servers and CDNs that support early hints.

What to do. Nothing to fix. You can use it to speed up page loads.

RFC 8297

2xx: Success

The request was received, understood and accepted.

200 OK

The request worked. The meaning of the body depends on the method: GET returns the resource, POST returns the result, and so on.

Common causes. A normal successful response.

What to do. Nothing to fix. A common mistake is returning 200 with an error message in the body: use a real 4xx or 5xx so clients and caches behave.

RFC 9110 §15.3.1 · Full page for 200

201 Created

The request worked and a new resource now exists.

Common causes. A successful POST or PUT that created something.

What to do. Return a Location header with the new resource's URL and, usually, the resource in the body.

RFC 9110 §15.3.2 · Full page for 201

202 Accepted

The request was accepted for processing but isn't finished. The result may come later, or never.

Common causes. Queued jobs, batch imports, anything done asynchronously.

What to do. Return a link the client can poll for status, or a webhook promise. Don't use it when the work was actually done.

RFC 9110 §15.3.3

203 Non-Authoritative Information

The request worked, but a proxy changed the response from what the origin sent.

Common causes. Transforming proxies.

What to do. Rare. Treat like 200.

RFC 9110 §15.3.4

204 No Content

The request worked and there is intentionally no body.

Common causes. DELETE, PUT or a PATCH that doesn't need to return anything; a CORS preflight response.

What to do. Make sure the body really is empty and there's no Content-Length other than 0. A fetch client calling .json() on a 204 will throw.

RFC 9110 §15.3.5 · Full page for 204

205 Reset Content

Success, and the client should reset the form or view that sent the request.

Common causes. Rarely used form flows.

What to do. Rare. Most sites just redirect instead.

RFC 9110 §15.3.6

206 Partial Content

The server is sending only the byte range the client asked for.

Common causes. Video and audio seeking, resumable downloads (Range header).

What to do. If seeking doesn't work, check the server sends Accept-Ranges: bytes and honours Range.

RFC 9110 §15.3.7

207 Multi-Status

WebDAV: the body has separate status codes for several resources.

Common causes. WebDAV bulk operations.

What to do. Read each entry in the XML body, not just the top-level code.

RFC 4918

208 Already Reported

WebDAV: members of a binding were already listed earlier in the response.

Common causes. WebDAV binding enumeration.

What to do. Rare.

RFC 5842

226 IM Used

The server applied an instance manipulation (delta encoding) to the response.

Common causes. Delta encoding (RFC 3229), almost never deployed.

What to do. Rare.

RFC 3229

3xx: Redirection

The client has to take another step, usually following a Location header.

300 Multiple Choices

There are several possible responses and the client or user should choose.

Common causes. Content negotiation that offers a list of formats or languages.

What to do. Rare. Servers usually pick for you or return 406.

RFC 9110 §15.4.1

301 Moved Permanently

The resource has a new permanent URL. Clients and search engines should use the new one from now on.

Common causes. Site moves, http to https redirects, trailing-slash fixes.

What to do. Send Location. Browsers cache 301s hard, so test with a 302 first. Note that old clients may change POST to GET when they follow it: use 308 to keep the method.

RFC 9110 §15.4.2 · Full page for 301

302 Found

The resource is temporarily at another URL. Keep using the original URL for future requests.

Common causes. Login redirects, A/B redirects, short links.

What to do. Use 307 if you need the method and body kept (POST stays POST), or 303 to force a GET.

RFC 9110 §15.4.3 · Full page for 302

303 See Other

The result is at another URL, and the client should fetch it with GET.

Common causes. The Post/Redirect/Get pattern after a form submit.

What to do. Send Location. This is the right code after a successful POST that redirects to a result page.

RFC 9110 §15.4.4

304 Not Modified

The cached copy is still good. No body is sent.

Common causes. A conditional request with If-None-Match (ETag) or If-Modified-Since that matched.

What to do. This is a success. If you never see 304s, check your ETag or Last-Modified headers are stable; a build that changes them on every deploy defeats caching.

RFC 9110 §15.4.5 · Full page for 304

305 Use Proxy

Deprecated: use a given proxy.

Common causes. Obsolete; browsers ignore it for security.

What to do. Don't use.

RFC 9110 §15.4.6 (deprecated)

307 Temporary Redirect

Like 302, but the client must repeat the request with the same method and body.

Common causes. Temporary maintenance redirects, HSTS internal redirects shown in browser dev tools.

What to do. Use this instead of 302 when a POST must stay a POST.

RFC 9110 §15.4.8 · Full page for 307

308 Permanent Redirect

Like 301, but the client must repeat the request with the same method and body.

Common causes. Permanent API moves where POST must stay POST.

What to do. Use this instead of 301 for non-GET requests.

RFC 9110 §15.4.9 · Full page for 308

4xx: Client error

Something is wrong with the request. Fix the request before trying again.

400 Bad Request

The server couldn't understand the request because it is malformed or invalid.

Common causes. Invalid JSON, a missing required field, a bad URL, a header that is too long or malformed, wrong Content-Type.

What to do. Read the response body: good APIs say what was wrong. Check the request in your browser's Network tab or with curl -v. Validate JSON, encoding of query strings, and required fields.

RFC 9110 §15.5.1 · Full page for 400

401 Unauthorized

The request has no valid credentials. (The name is misleading: it means unauthenticated.)

Common causes. Missing or expired token, wrong password, a bad Authorization header, a JWT with the wrong signature or past its exp.

What to do. Send valid credentials. The response should include WWW-Authenticate saying how. Decode your JWT to check expiry and audience.

RFC 9110 §15.5.2 · Full page for 401

402 Payment Required

Reserved for future use. Some APIs use it when a plan or quota needs payment.

Common causes. Billing limits on some APIs (Stripe-style and others).

What to do. Check the API's own documentation for what it means there.

RFC 9110 §15.5.3

403 Forbidden

The server understood you and refuses. Logging in again will not help: you are not allowed.

Common causes. Missing permission or role, an IP block, a WAF or bot rule, a directory with no index file, CORS or CSRF failure on some stacks, wrong file permissions.

What to do. Check the permissions of the account or token, firewall and WAF rules, and file ownership. Some sites return 403 instead of 404 to hide that a page exists.

RFC 9110 §15.5.4 · Full page for 403

404 Not Found

The server can't find the resource at that URL.

Common causes. A typo, a deleted or moved page, a wrong base path or case (URLs are case-sensitive on most servers), a missing static file after a deploy, a route that isn't registered.

What to do. Check the exact URL, the case, the trailing slash, and that the file or route exists on the server you are hitting. Use 410 if it is gone for good, and 301 if it moved.

RFC 9110 §15.5.5 · Full page for 404

405 Method Not Allowed

The URL exists but it doesn't accept that HTTP method.

Common causes. POST to a URL that only supports GET, or a route that isn't set up for PUT or DELETE. Static hosts return it for POST.

What to do. Read the Allow header: it lists the methods that work. Check you aren't posting to a static file server.

RFC 9110 §15.5.6 · Full page for 405

406 Not Acceptable

The server can't produce a response matching the client's Accept headers.

Common causes. Asking for a format or language the server doesn't have.

What to do. Relax the Accept header or add the format on the server.

RFC 9110 §15.5.7

407 Proxy Authentication Required

Like 401, but the proxy needs credentials first.

Common causes. A corporate or paid proxy.

What to do. Send Proxy-Authorization.

RFC 9110 §15.5.8

408 Request Timeout

The server gave up waiting for the client to finish sending the request.

Common causes. A slow or dropped connection while uploading; an idle keep-alive connection closed by the server.

What to do. Retry. For large uploads, raise the server's body or header timeout.

RFC 9110 §15.5.9

409 Conflict

The request conflicts with the current state of the resource.

Common causes. Editing a version that changed since you read it, creating something that already exists (duplicate key), a git merge conflict in an API.

What to do. Fetch the latest version, resolve the difference, and try again. APIs use If-Match with an ETag to detect this.

RFC 9110 §15.5.10 · Full page for 409

410 Gone

The resource used to exist and is permanently gone, with no forwarding address.

Common causes. Deliberately removed pages and expired content.

What to do. Search engines drop a 410 faster than a 404. Use it when you mean it.

RFC 9110 §15.5.11

411 Length Required

The server needs a Content-Length header.

Common causes. Some servers reject chunked uploads.

What to do. Send Content-Length instead of chunked encoding.

RFC 9110 §15.5.12

412 Precondition Failed

A condition in the request headers (If-Match, If-Unmodified-Since) was false.

Common causes. Optimistic concurrency checks that failed.

What to do. Reload the resource and retry with the new ETag.

RFC 9110 §15.5.13

413 Content Too Large

The request body is bigger than the server allows. (Formerly “Payload Too Large”.)

Common causes. Uploading a big file; nginx's default client_max_body_size is 1 MB; a CDN or proxy upload limit.

What to do. Raise the limit (client_max_body_size in nginx, LimitRequestBody in Apache, the CDN's plan limit) or upload in chunks.

RFC 9110 §15.5.14 · Full page for 413

414 URI Too Long

The URL is longer than the server will accept.

Common causes. Huge query strings, a loop of redirects that keeps adding parameters.

What to do. Move data into a POST body. Most servers stop at 8 KB.

RFC 9110 §15.5.15

415 Unsupported Media Type

The server doesn't support the format of the request body.

Common causes. Sending JSON without Content-Type: application/json, or form data to a JSON-only endpoint.

What to do. Set the right Content-Type and send a body in that format.

RFC 9110 §15.5.16 · Full page for 415

416 Range Not Satisfiable

The byte range asked for is outside the resource.

Common causes. A resumed download from a file that changed or got shorter.

What to do. Restart the download from zero.

RFC 9110 §15.5.17

417 Expectation Failed

The server can't meet what the Expect header asked for.

Common causes. Some proxies reject Expect: 100-continue.

What to do. Remove the Expect header.

RFC 9110 §15.5.18

418 I'm a teapot

An April Fools' joke from RFC 2324 (the Hyper Text Coffee Pot Control Protocol): the server is a teapot and can't brew coffee.

Common causes. Easter eggs, and some services use it on purpose to block bots or scrapers.

What to do. Nothing to fix. If you see it from a real service, they are refusing you deliberately.

RFC 2324 / RFC 9110 §15.5.19 (unused)

421 Misdirected Request

The request was sent to a server that can't give a response for that host name.

Common causes. HTTP/2 connection reuse across hosts that share a certificate; a proxy that routes by SNI wrongly.

What to do. Open a new connection for that host; fix the TLS or virtual-host configuration.

RFC 9110 §15.5.20

422 Unprocessable Content

The request is well-formed but the server can't process the data in it. (Formerly “Unprocessable Entity”.)

Common causes. Validation errors in APIs (Rails, FastAPI, Laravel): a field is the wrong type, an email is invalid.

What to do. Read the body: it usually lists each field and why it failed.

RFC 9110 §15.5.21 · Full page for 422

423 Locked

WebDAV: the resource is locked.

Common causes. A document someone else is editing.

What to do. Wait for the lock, or send the lock token.

RFC 4918

424 Failed Dependency

WebDAV: the request failed because an earlier request it depended on failed.

Common causes. Batch WebDAV operations.

What to do. Fix the first failure.

RFC 4918

425 Too Early

The server won't risk processing a request that might be replayed (TLS early data).

Common causes. TLS 1.3 0-RTT replay protection.

What to do. Retry after the handshake completes.

RFC 8470

426 Upgrade Required

The server refuses to serve the request with this protocol; the client must upgrade.

Common causes. A server that requires TLS 1.2+ or a newer HTTP version.

What to do. Follow the Upgrade header.

RFC 9110 §15.5.22

428 Precondition Required

The server requires the request to be conditional (with If-Match).

Common causes. APIs that prevent lost updates.

What to do. Add If-Match with the ETag you last saw.

RFC 6585

429 Too Many Requests

You have sent too many requests in a given time (rate limiting).

Common causes. API rate limits, login throttling, scraping, a retry loop with no delay.

What to do. Slow down and obey the Retry-After header if there is one. Use exponential backoff with a little random jitter.

RFC 6585 · Full page for 429

431 Request Header Fields Too Large

The headers are too big, in total or one by one.

Common causes. Huge cookies, a giant Authorization token, a header that keeps growing.

What to do. Clear cookies, shrink the token, or raise the server's header limit (large_client_header_buffers in nginx).

RFC 6585

451 Unavailable For Legal Reasons

The content is blocked for legal reasons. The number is a nod to the novel Fahrenheit 451.

Common causes. Court orders, government blocks, GDPR geo-blocking.

What to do. Nothing to fix on your side.

RFC 7725

5xx: Server error

The server failed to handle a valid request. The client can usually retry later.

500 Internal Server Error

The server hit an unexpected problem and can't say more. It's the generic 'the server's code broke' response.

Common causes. An unhandled exception, a bug, a misconfigured server, a broken database connection, a bad deploy, a permissions problem on files.

What to do. It's the server's fault, not the request's. Read the server's error log: that is where the real message is. As a client, retry later and report it.

RFC 9110 §15.6.1 · Full page for 500

501 Not Implemented

The server doesn't support what the request needs, such as the method.

Common causes. A server that doesn't know the method (e.g. PATCH, or a made-up one).

What to do. Use a method the server supports.

RFC 9110 §15.6.2

502 Bad Gateway

A gateway or proxy got an invalid response from the server behind it.

Common causes. The app behind nginx, a load balancer or a CDN crashed, restarted, or isn't listening; a wrong upstream port; PHP-FPM down.

What to do. Check that the upstream app is running and on the right address and port, look at both the proxy and the app logs, and watch for crashes and out-of-memory kills.

RFC 9110 §15.6.3 · Full page for 502

503 Service Unavailable

The server can't handle the request right now, usually because of overload or maintenance. It should be temporary.

Common causes. Maintenance mode, overload, a deploy in progress, autoscaling that hasn't caught up, a dependency down.

What to do. Retry later; respect Retry-After. As an operator, add capacity or fix the dependency, and return 503 (not 200) for planned maintenance so search engines don't index the error page.

RFC 9110 §15.6.4 · Full page for 503

504 Gateway Timeout

A gateway or proxy waited too long for the server behind it.

Common causes. A slow database query or upstream call, a proxy timeout lower than the job's run time (nginx proxy_read_timeout defaults to 60 s).

What to do. Speed up the slow step, raise the proxy timeout, or turn the job into a background task that returns 202.

RFC 9110 §15.6.5 · Full page for 504

505 HTTP Version Not Supported

The server doesn't support the HTTP version used in the request.

Common causes. An old or unusual client.

What to do. Use HTTP/1.1.

RFC 9110 §15.6.6

506 Variant Also Negotiates

Content negotiation is configured circularly.

Common causes. Server misconfiguration.

What to do. Fix the server's transparent-negotiation setup.

RFC 2295

507 Insufficient Storage

WebDAV: the server is out of space to store the request.

Common causes. A full disk.

What to do. Free space.

RFC 4918

508 Loop Detected

WebDAV: the server found an infinite loop.

Common causes. Circular bindings.

What to do. Fix the cycle.

RFC 5842

510 Not Extended

The request needs extensions that the server doesn't support.

Common causes. Almost never seen.

What to do. Rare.

RFC 2774 (historic)

511 Network Authentication Required

You must log in to the network first.

Common causes. Captive portals at hotels and cafés.

What to do. Open any plain http page to bring up the login portal.

RFC 6585

Non-standard codes

Not in the HTTP standards. These come from nginx, Cloudflare, Laravel and some hosts, and you will see them in logs and error pages.

419 Page Expired

Non-standard (Laravel): the CSRF token is missing or has expired.

Common causes. A form left open too long, or a session that expired.

What to do. Reload the page to get a fresh token and send the form again.

Laravel (not in any RFC)

444 No Response

Non-standard (nginx): the server closed the connection without sending anything.

Common causes. A return 444; rule in the nginx config, used to drop unwanted requests.

What to do. Only appears in nginx's own logs. Remove the rule if you did not intend it.

nginx (not in any RFC)

494 Request Header Too Large

Non-standard (nginx): the request header was too big.

Common causes. Huge cookies.

What to do. Clear cookies, or raise large_client_header_buffers.

nginx (not in any RFC)

495 SSL Certificate Error

Non-standard (nginx): the client certificate was invalid.

Common causes. Mutual TLS setups.

What to do. Check the client certificate.

nginx (not in any RFC)

496 SSL Certificate Required

Non-standard (nginx): a client certificate was needed and not sent.

Common causes. Mutual TLS setups.

What to do. Send a client certificate.

nginx (not in any RFC)

497 HTTP Request Sent to HTTPS Port

Non-standard (nginx): a plain-HTTP request arrived on an HTTPS port.

Common causes. Using http:// with port 443.

What to do. Use https://, or use port 80.

nginx (not in any RFC)

499 Client Closed Request

Non-standard (nginx): the client hung up before the server answered.

Common causes. A user left the page, a client with a short timeout, a mobile network drop.

What to do. Often harmless. If it is frequent, the server is too slow: see 504.

nginx (not in any RFC)

509 Bandwidth Limit Exceeded

Non-standard (Apache extension, cPanel hosts): the site has used up its bandwidth.

Common causes. A shared-hosting plan limit.

What to do. Upgrade the plan or wait for the period to reset.

cPanel hosts (not in any RFC)

520 Web Server Returned an Unknown Error

Non-standard (Cloudflare): the origin server sent something Cloudflare can't understand.

Common causes. The origin crashed, sent huge headers, or closed the connection early.

What to do. Check your origin server's logs and its response headers.

Cloudflare (not in any RFC)

521 Web Server Is Down

Non-standard (Cloudflare): Cloudflare couldn't connect to your origin server.

Common causes. The origin is down, or its firewall blocks Cloudflare's addresses.

What to do. Start your server and allow Cloudflare's IP ranges.

Cloudflare (not in any RFC)

522 Connection Timed Out

Non-standard (Cloudflare): Cloudflare couldn't finish connecting to your origin in time.

Common causes. An overloaded origin, a wrong IP, or a firewall dropping packets.

What to do. Check the origin's address, load and firewall.

Cloudflare (not in any RFC)

523 Origin Is Unreachable

Non-standard (Cloudflare): the route to your origin failed.

Common causes. A wrong IP in DNS, or a routing problem.

What to do. Fix the DNS record and check the network path.

Cloudflare (not in any RFC)

524 A Timeout Occurred

Non-standard (Cloudflare): the origin accepted the connection but took longer than about 100 seconds to answer.

Common causes. A slow job running inside a web request.

What to do. Move the job to a background worker and return quickly.

Cloudflare (not in any RFC)

525 SSL Handshake Failed

Non-standard (Cloudflare): the TLS handshake with your origin failed.

Common causes. The origin doesn't accept the TLS settings Cloudflare uses.

What to do. Check the origin's TLS certificate and supported versions.

Cloudflare (not in any RFC)

526 Invalid SSL Certificate

Non-standard (Cloudflare): the origin's certificate isn't valid.

Common causes. Expired or self-signed certificates in 'Full (strict)' mode.

What to do. Install a valid certificate on the origin.

Cloudflare (not in any RFC)

530 Origin DNS Error

Non-standard (Cloudflare): usually shown with an error 1xxx, such as the site's DNS being wrong.

Common causes. A DNS misconfiguration or a suspended site.

What to do. Read the 1xxx code on the page and fix the DNS record.

Cloudflare (not in any RFC)

How to use it

  1. Type a code or a word like timeout in the search box.
  2. Open a row to read what it means, the usual causes and what to do.
  3. For the common codes, open the full page for more detail.

Questions

What is the difference between 401 and 403?

401 means “I don't know who you are”: the credentials are missing or wrong, so logging in can fix it. 403 means “I know who you are and the answer is no”: you are authenticated but not allowed.

What is the difference between 301 and 302?

301 says the move is permanent (browsers and search engines remember it and update). 302 says it is temporary (keep using the old URL). For redirects that must keep a POST a POST, use 308 (permanent) or 307 (temporary).

Which codes should an API use for validation errors?

400 when the request can't be parsed at all, and 422 when it parses but the data fails validation. Many APIs use 400 for both, and that is fine if the body explains.

What are 5xx errors and who should fix them?

5xx means the server failed on a valid request. The fix is on the server side: read its error log. As a client, retry with backoff, and honour Retry-After on a 503.

Are 418 and 451 real?

418 I'm a teapot comes from an April Fools' RFC, and servers sometimes use it to refuse bots. 451 is real: it means the content is blocked for legal reasons.

Is what I paste or test sent anywhere?

No. This page works entirely inside your browser, and pasted data never leaves your device. It makes no network requests while you use it, and the page also tells your browser to block them (a Content-Security-Policy with connect-src 'none'), so even a bug could not send your data out. To check it yourself, open your browser's developer tools, go to the Network tab, and use the tool: nothing will appear. There is no account, no analytics and no logging.