One Click Answers

In plain English

What Does an HTTP Status Code Tell You?

The Simple Answer

An HTTP status code is a three digit number a server sends to say how it handled one request. The first digit gives the family: 2 means success, 3 means redirect, 4 means a problem with the request, and 5 means a server problem.

How do you read a status code?

The first digit sorts the code into a family. The full number gives the detail. A status code describes a single request to a single address at one moment. It does not tell you whether the whole site works.

Common status codes and what to check
CodeNameMeaningCheck next
200OKThe request succeededDoes the page show the right content?
301Moved PermanentlyThe address changed for goodFollow the Location header
302FoundA temporary moveFollow the Location header
403ForbiddenThe server refuses accessCheck permissions and blocking rules
404Not FoundNothing at this addressCheck the spelling and the publishing state
429Too Many RequestsToo many requests in a short timeSlow down and retry later
500Internal Server ErrorThe server failed unexpectedlyAsk for server logs
503Service UnavailableThe server cannot handle it nowCheck for maintenance or overload

Codes in the 4xx family say the request was the problem: a wrong address, missing login or blocked access. Codes in the 5xx family say the request was fine and the server failed. That split tells you who can fix it. You can fix a 4xx address. Only the host or developer can fix most 5xx errors.

MDN groups status codes into five classes: 1xx informational, 2xx successful, 3xx redirection, 4xx client error and 5xx server error. It describes 404 as the server being unable to find the requested resource and 500 as the server meeting a situation it does not know how to handle.

What do other codes mean?

Some codes are easy to confuse. A 401 means the request needs valid login details, while a 403 means the server understood and still refuses. A 410 says the page is gone on purpose, while a 404 only says it was not found. A 502 or 504 usually means one server got a bad or late answer from another server behind it.

Example: reading a short report

Assume you test four addresses on a small shop site.

Home page: 200. The page loaded.

/shop: 301 to /store. The page moved, so follow it.

/store: 200. The move works.

/old-sale: 404. The page is gone, so remove links to it or add a redirect.

Example: counting errors in a log

Assume a log shows 400 requests in an hour.

12 of them returned a 5xx code.

Share of server errors = 12 / 400 = 0.03, which is 3%.

Ask the host what happened at those times.

What mistakes should I avoid when reading an HTTP status code?

  • Treating a 200 on the homepage as proof the whole site works.
  • Reading the first digit only and ignoring the exact code.
  • Using 200 for a missing page that only displays a friendly error message.
  • Refreshing again and again instead of writing down the code and the time.
  • Blaming the visitor for a 5xx, which is a server problem.
  • Using a temporary redirect code when a page has moved for good.

What changes the answer when reading an HTTP status code?

A page can return 200 and still be broken. For example, it may show an error message in the body. Always view the page as well as the code. A form or checkout needs a real test, not just a code.

The same address may give different codes depending on the request method, the login state, the location or a cached copy. A header-only check may differ from a full page load. Know what your checker tested before you compare two reports.

Search tools and browsers also treat codes differently. A 404 and a 410 both mean the page is not there, and a 301 tells them to update to the new address. Use the code that tells the truth about the page, so every system reads it the same way.

A quick checklist for reading an HTTP status code

  1. Write down the full address, the time and the code.
  2. Look at the first digit to find the family.
  3. For 3xx, follow the Location header to the final page.
  4. For 4xx, check the address, spelling, login and permissions.
  5. For 5xx, send the time and address to the host and ask for logs.
  6. Retest the same address after any change.

HTTP Header Checker: Enter an address and see its status code and response headers, so you know what the server said.

How we know

How the numbers were worked out. The worked examples use made-up round numbers, calculated with plain arithmetic. Replace them with your own figures; prices, rates and speeds change.

Sources

Published by OneClickAnswers.

You might also wonder...

Try it yourself

  • HTTP Header CheckerSee the HTTP response headers a website sends, with a plain summary first and what each one means.
  • Redirect CheckerFollow a link step by step and see every redirect and status code.
  • Website Health CheckCheck a website for common problems and see what to fix first.

← All articles

Got another question?

Free, no account. Answers show how they were worked out.