ZapKit

HTTP status codes

Look up what an HTTP status code means and what to do about it, from 200 OK to 504 Gateway Timeout.

What are HTTP status codes?

HTTP status codes are three-digit numbers a web server returns with every response to say what happened. The first digit gives the class: 1xx informational, 2xx success, 3xx redirection, 4xx a problem with the request, and 5xx a problem on the server.

This reference lists every standard code with its official name, class and a plain explanation of when it's used. Search by number or keyword, filter by class, and copy any code. Exact matches jump to the top of the list.

How to use the HTTP status codes

  1. 1.Search

    A code like 403, or words like redirect or timeout.

  2. 2.Filter by class

    1xx to 5xx.

  3. 3.Copy

    Copy the code for docs or code.

Example: diagnosing an error

An app shows errors after a deploy:

502 Bad Gateway
the proxy got an invalid reply: the app crashed or isn't listening
504 Gateway Timeout
the app answered too slowly: check slow queries
429 Too Many Requests
a rate limit: back off and respect Retry-After

The code alone narrows down where to look.

Commonly confused pairs

401 means you're not authenticated (log in); 403 means you are, but aren't allowed. 301 and 308 are permanent redirects and 302 and 307 temporary; 307 and 308 promise to keep the method, so a POST stays a POST. 502 means a gateway got a bad reply from the server behind it, 504 that it got no reply in time.

422 is for well-formed requests that fail validation, 409 for conflicts with the current state, and 429 for rate limits, usually with a Retry-After header saying when to try again.

Frequently asked questions

Which redirect is best for SEO?

301 or 308 for permanent moves; search engines pass ranking to the new URL.

Should an API return 200 with an error inside?

Better not. A 4xx or 5xx code lets clients and monitoring spot failures.

Is 418 real?

It began as a 1998 April Fools' joke and stays reserved.

Where do these come from?

Mainly RFC 9110, plus WebDAV and other extensions.

More Developer tools