HTTP Status Codes
NewEvery HTTP status code, searchable, with when to use it.
- Runs in your browser
- Web
1xx · Informational
- 100ContinueThe client should continue sending the request body.
- 101Switching ProtocolsCommonThe server is switching protocols, for example to WebSocket.
- 103Early HintsPreload hints sent before the final response.
2xx · Success
- 200OKCommonThe request succeeded.
- 201CreatedCommonA new resource was created. Usually returned by POST, with a Location header.
- 202AcceptedAccepted for processing, but not finished yet. Good for async jobs.
- 204No ContentCommonSuccess with no body. Common for DELETE and PUT.
- 206Partial ContentOnly part of the resource is returned, in response to a Range header.
3xx · Redirection
- 301Moved PermanentlyCommonThe resource has a new permanent URL. Search engines follow it.
- 302FoundTemporary redirect. Browsers may change POST to GET.
- 303See OtherRedirect to another URL with GET, often after a form POST.
- 304Not ModifiedCommonThe cached copy is still valid; nothing is sent.
- 307Temporary RedirectTemporary redirect that keeps the method and body.
- 308Permanent RedirectPermanent redirect that keeps the method and body.
4xx · Client error
- 400Bad RequestCommonThe request is malformed or fails validation.
- 401UnauthorizedCommonAuthentication is missing or invalid. Really means unauthenticated.
- 402Payment RequiredReserved; some APIs use it for billing limits.
- 403ForbiddenCommonAuthenticated, but not allowed to do this.
- 404Not FoundCommonNo resource at this URL.
- 405Method Not AllowedThe URL exists but not for this HTTP method.
- 406Not AcceptableNo representation matches the Accept headers.
- 408Request TimeoutThe client took too long to send the request.
- 409ConflictCommonThe request conflicts with the current state, like a duplicate or a version clash.
- 410GoneThe resource was removed on purpose and won't be back.
- 411Length RequiredA Content-Length header is required.
- 412Precondition FailedAn If-Match or similar condition did not hold.
- 413Content Too LargeThe request body is bigger than the server accepts.
- 414URI Too LongThe URL is longer than the server will handle.
- 415Unsupported Media TypeThe Content-Type of the body isn't supported.
- 418I'm a teapotAn April Fools' joke from 1998 that never went away.
- 422Unprocessable ContentCommonWell-formed, but semantically invalid. Popular for validation errors.
- 425Too EarlyThe server won't process a request that might be replayed.
- 428Precondition RequiredThe server requires a conditional request to avoid lost updates.
- 429Too Many RequestsCommonRate limit hit. Check the Retry-After header.
- 431Request Header Fields Too LargeHeaders are too big, often due to oversized cookies.
- 451Unavailable For Legal ReasonsBlocked for legal reasons, such as a court order.
5xx · Server error
- 500Internal Server ErrorCommonSomething broke on the server.
- 501Not ImplementedThe server doesn't support this functionality.
- 502Bad GatewayCommonA proxy got an invalid response from the upstream server.
- 503Service UnavailableCommonOverloaded or down for maintenance. Often temporary.
- 504Gateway TimeoutCommonA proxy didn't get a response from upstream in time.
- 505HTTP Version Not SupportedThe HTTP version used isn't supported.
- 507Insufficient StorageThe server can't store what is needed to finish the request.
- 511Network Authentication RequiredLog in to the network first, like a captive portal.
How to use the HTTP Status Codes
- 1Search by number or words, such as 404, timeout or redirect.
- 2Turn on Most used only to see the codes you'll meet daily.
- 3Read the short explanation of when each code applies.
Questions
What's the difference between 401 and 403?
401 means you aren't authenticated (log in first). 403 means you are, but you aren't allowed to do this.
Should I use 301 or 308 for a permanent redirect?
Both are permanent. 308 guarantees the method and body are kept, which matters for POST requests. For plain page moves, 301 is fine.
When should an API return 422 instead of 400?
Many APIs use 400 for malformed requests and 422 for well-formed requests that fail validation.