HTTP Status Codes

Searchable reference of every HTTP status code with what it means and when to use it.

1xx Informational
100ContinueThe server got the request headers and the client should send the body.
101Switching ProtocolsThe server agrees to switch protocols, e.g. to WebSocket.
2xx Success
200OKThe request succeeded. The standard success response.
201CreatedA new resource was created. The response usually includes its location.
202AcceptedThe request was accepted for processing but is not done yet.
204No ContentSuccess, with nothing to return. Common for DELETE and PUT.
206Partial ContentA range request succeeded; this is part of the resource. Used for video streaming and resumable downloads.
3xx Redirection
301Moved PermanentlyThe resource lives at a new URL forever. Browsers and search engines update their records.
302FoundTemporary redirect. The original URL is still canonical.
304Not ModifiedThe cached version is still valid; no body is sent. The backbone of HTTP caching.
307Temporary RedirectLike 302, but the request method must not change when following it.
308Permanent RedirectLike 301, but the request method must not change. Used for redirecting POST endpoints.
4xx Client error
400Bad RequestThe request is malformed: invalid JSON, missing fields, bad syntax.
401UnauthorizedAuthentication is missing or wrong. Misnamed: it means unauthenticated.
403ForbiddenAuthenticated, but not allowed to do this. This one means unauthorized.
404Not FoundThe resource does not exist, or the server does not want to admit it exists.
405Method Not AllowedThe resource exists but not for this HTTP method, e.g. POST to a read only endpoint.
409ConflictThe request conflicts with current state: duplicate entry, edit collision, version mismatch.
410GoneThe resource existed and was deliberately removed. Stronger than 404.
413Payload Too LargeThe request body exceeds what the server accepts. Common with file uploads.
415Unsupported Media TypeThe Content-Type of the request is not supported, e.g. XML sent to a JSON API.
418I'm a teapotAn April Fools joke from 1998 that servers still implement for fun.
422Unprocessable EntityThe syntax is valid but the content fails validation rules. The standard validation error code.
429Too Many RequestsRate limited. The Retry-After header says when to try again.
5xx Server error
500Internal Server ErrorSomething broke on the server. The catch-all for unhandled exceptions.
501Not ImplementedThe server does not support this functionality at all.
502Bad GatewayA proxy or load balancer got an invalid response from the server behind it.
503Service UnavailableThe server is overloaded or down for maintenance. Temporary by definition.
504Gateway TimeoutA proxy gave up waiting for the server behind it to respond.

About the HTTP Status Codes

Every HTTP response starts with a three digit status code, and choosing or interpreting the right one is a daily task for anyone building or consuming APIs. This is a searchable reference of the codes that matter, grouped by class, with descriptions written for practical use rather than copied from the RFC.

The classes: 1xx informational (rare), 2xx success, 3xx redirection, 4xx the client did something wrong, 5xx the server did something wrong. That last distinction is the one worth internalizing, because it determines who needs to fix the problem and whether retrying can help.

The pairs that cause the most confusion: 401 vs 403 (not logged in vs logged in but not allowed), 301 vs 302 (permanent vs temporary redirect, which matters enormously for SEO), and 400 vs 422 (malformed request vs well formed request that fails validation).

Your ad could be here

Reach developers and designers who use these tools every day. Privacy-first, no trackers.

Frequently asked questions

What is the difference between 401 and 403?

401 means the request lacks valid authentication: not logged in, expired token, wrong API key. 403 means authentication succeeded but this identity is not allowed to do this. The names are misleading; the behaviors are exactly opposite to what they sound like.

When should I use 301 vs 302?

301 when the move is permanent: search engines transfer ranking to the new URL and browsers cache the redirect aggressively. 302 when temporary. Using 301 for something that later moves back is painful because the redirect is cached.

Which code for validation errors?

422 Unprocessable Entity is the conventional choice for syntactically valid requests that fail business validation, with 400 reserved for requests that cannot be parsed at all. Plenty of APIs use 400 for both, which is acceptable; just be consistent.