About this HTTP status code reference
Every HTTP response starts with a three-digit status code that tells the client what happened. The first digit gives the class: 1xx informational, 2xx success, 3xx redirection, 4xx client error, and 5xx server error. Picking the right code matters for browsers, search engines, caches, and the developers who use your API. This reference covers 62 standard codes from 100 Continue to 511 Network Authentication Required. For each one it explains what it means, when to use it and when a different code is better, which headers belong with it, and how to send it in Express, Django, FastAPI, and Go.
How to look up a status code
- Search or filter. Type a number such as 404 or a word such as redirect, choose a Status class, or press a common code.
- Press Find status codes. Matching codes appear as cards. Leave the box empty to list every code in the class you chose.
- Read the details. Each card explains the meaning, when to use the code and when not to, and the headers it needs.
- Copy the code sample. Use the Express, Django, FastAPI, or Go sample, or press a related code to look it up next.
Frequently asked questions
What is the difference between 401 and 403?
401 Unauthorized means the request has no valid login, so signing in may help. 403 Forbidden means the server knows who you are, but you are not allowed to do this, so signing in again will not help.
Should I use 301 or 302 for a redirect?
Use 301 when the move is permanent, such as a renamed page or a new domain, so search engines transfer ranking. Use 302 for temporary detours. Use 308 or 307 when a POST must stay a POST.
When should an API return 400 versus 422?
Return 400 when the request cannot be parsed, such as broken JSON or a wrong content type. Return 422 when it parses fine but fails validation, such as an invalid email address, and list the field errors in the body.
What is the difference between 502, 503, and 504?
502 means a proxy got a broken answer from the app behind it, 504 means the proxy waited too long for an answer, and 503 means the service itself is down or overloaded on purpose, for example during maintenance.
Is 404 or 410 better for deleted pages?
Both remove a page from search results, but 410 Gone says the removal is deliberate and permanent, so search engines usually drop it sooner. Use 404 when you are not sure the page will stay gone.