How to use the HTTP Status Codes Reference
- 1. Search or filterType a number such as 502 or a word such as redirect, or pick a class.
- 2. Open a codeTap a code to read what it means and the common cause.
- 3. Keep a copyDownload the full list as a text file for offline use.
How to read a status code
The first digit tells you who is responsible. 2xx means it worked, 3xx means go somewhere else, 4xx means the request was wrong (the client's side) and 5xx means the server failed. 1xx codes are interim messages most people never see.
So when an API returns 401 you fix your token, but when it returns 503 there is nothing wrong with your request and you should retry later. This one rule saves a lot of debugging time.
Worked example: type redirect in the search box and the list narrows to the redirect codes. Comparing them shows why 308 exists: like 301 it is permanent, but it guarantees a POST stays a POST.
Codes that confuse beginners
- 401 vs 403: 401 means "who are you?" and logging in can fix it. 403 means "I know who you are, and the answer is no".
- 404 vs 410: 404 says nothing is here. 410 says it was here and was removed on purpose.
- 400 vs 422: 400 is broken syntax such as invalid JSON. 422 is valid JSON with values that fail validation.
- 502 vs 504: both come from a proxy such as nginx. 502 got a bad answer from the app; 504 got no answer in time.
- 301 vs 302: use 301 when a page has moved for good so search engines move the ranking; use 302 for a short-term move.
When you build REST APIs, choosing the right code makes your API easier for others to use. Pair this list with the JSON formatter when you debug responses.
Frequently asked questions
Which status codes should a REST API use most?
Most APIs get by with 200, 201, 204, 400, 401, 403, 404, 409, 422, 429 and 500. Use the more specific ones when they fit.
Is 418 a real status code?
It was defined as an April Fools' joke in RFC 2324. Some servers return it for fun, but you should not use it for real errors.
Does a 404 hurt SEO?
A few 404s for pages that really do not exist are normal. Problems come when important pages return 404 or when internal links point to missing pages.
Do I need to sign up to use this list?
No. The list is free, and searching and reading are open to all. Only the text download asks for your name and WhatsApp number, and only once across all Uncodemy tools.