HTTP status codes

Every HTTP status code with what it means and when to use it.

Runs in your browser. Your input is not uploaded.

Loading the tool…

What it does

Every HTTP response starts with a three-digit status code. The first digit is the class: 1xx informational, 2xx success, 3xx redirection, 4xx client error and 5xx server error.

This reference follows RFC 9110 and lists each code with what it means and when to return it, plus the pairs people mix up.

How to use it

  1. Search by number or name, or browse by class.
  2. Read the meaning and the note on when to use it.

Things to watch for

  • 301 and 302 allow clients to change POST into GET. Use 308 and 307 when the method must be kept.
  • 401 means “not authenticated”, despite its name. 403 means “authenticated but not allowed”.

Questions

What is the difference between 301 and 302?
301 is permanent and search engines move ranking to the new URL. 302 is temporary and the old URL stays indexed.
When should I use 422 instead of 400?
422 when the request is well-formed but fails validation, such as a missing field. 400 when it cannot be parsed at all.
What is the difference between 404 and 410?
404 says nothing is here. 410 says it was here and was removed on purpose, and search engines drop it sooner.
What does 418 mean?
“I’m a teapot”, from an April Fools RFC. It is reserved and should not be used for real errors.
What does 502 Bad Gateway mean?
A proxy or load balancer could not get a valid response from the application behind it. Check the app logs.