We noticed you're using an ad blocker - no worries! Visit our Support Page to help keep it free for everyone.

HTTP Status Codes

Why status codes are worth knowing

You've almost certainly seen "404 Not Found" or "500 Internal Server Error" on a web page. They look like technical gibberish, but each one is a short, precise message from a website explaining what happened to your request.

These messages are called HTTP status codes. HTTP (Hypertext Transfer Protocol) is the set of rules your browser and websites use to talk to each other. Every time you load a page, the website replies with a three-digit status code, even when everything works perfectly.

Knowing what the common codes mean helps you work out whether a problem is at your end or the website's, what you can do about it, and what's going on when a link sends you somewhere else. If you run a website, they're essential for keeping it healthy.

How a web request works

When you visit a page, two things are talking. Your browser is the client (the one asking), and the computer that hosts the website is the server (the one answering).

  1. Your browser sends a request: "Please give me the page at /recipes/pavlova."
  2. The server works out what to do with it.
  3. The server sends back a response: a status code, some extra information called headers, and usually the page itself.

Here's a simplified version of that conversation:

Browser asks:   GET /recipes/pavlova HTTP/1.1
                Host: www.example.com.au

Server replies: HTTP/1.1 200 OK
                Content-Type: text/html; charset=utf-8

                <html> ...the pavlova recipe page... </html>

GET means "fetch this for me", and 200 OK is the status code meaning everything went well. You don't normally see any of this, because your browser just shows you the page.

The five families of status codes

Status codes are grouped by their first digit. Once you know the five groups, you can understand the gist of almost any code, even one you've never seen. People often write the groups as 1xx, 2xx and so on, where "xx" means "any two digits".

Think of ordering at a café:

GroupMeaningAt the café
1xx Informational"Got it, still working on it""Your order's in, won't be long."
2xx SuccessThe request worked"Here's your flat white."
3xx RedirectionWhat you want is somewhere else"We serve that at the counter next door."
4xx Client errorSomething's wrong with the request"Sorry, that's not on our menu." or "Staff only."
5xx Server errorThe website itself has a problem"The coffee machine's broken."

The most useful distinction for everyday browsing is between 4xx and 5xx. A 4xx code usually means the request needs changing (a different address, logging in, waiting a bit). A 5xx code means the website is having trouble, and there's often little you can do except try again later.

Tip: "client error" doesn't mean you did something wrong. A 404 is technically a client error, but it's often caused by a website moving or deleting a page and leaving an old link behind.

The codes you'll meet most often

There are dozens of official status codes, defined in a standard called RFC 9110, but a small handful cover nearly everything you'll come across.

Success (2xx)

CodeNameWhat it means
200OKEverything worked and the page was sent. This is the code behind almost every page you load.
201CreatedSomething new was created, such as a new account or post.
204No ContentIt worked, but there's nothing to send back (common for "save" actions in apps).

Redirection (3xx)

CodeNameWhat it means
301Moved PermanentlyThe page has a new permanent address. Your browser goes there automatically.
302FoundThe page is temporarily somewhere else. Your browser goes there automatically.
304Not ModifiedNothing has changed since your last visit, so your browser reuses its saved copy. This makes pages load faster.
307 / 308Temporary / Permanent RedirectStricter versions of 302 and 301 (more on these below).

You normally never see a redirect happen; the browser just follows it silently and you land on the new page.

Client errors (4xx)

CodeNameWhat it means
400Bad RequestThe server couldn't make sense of the request, sometimes due to a mangled link or a corrupted cookie.
401UnauthorizedDespite the name, this really means "unauthenticated": the server doesn't know who you are. Logging in usually fixes it.
403ForbiddenThe server knows who you are (or doesn't need to) and still won't let you in. Logging in again won't help.
404Not FoundThere's nothing at that address. The page may have moved, been deleted, or the link may contain a typo.
410GoneThe page was deliberately removed and isn't coming back.
429Too Many RequestsYou (or your network) have made too many requests too quickly. Wait a while and try again.

Server errors (5xx)

CodeNameWhat it means
500Internal Server ErrorSomething broke on the website and it can't say exactly what. A general "oops".
502Bad GatewayOne server got an invalid answer from another server behind it.
503Service UnavailableThe site is overloaded or down for maintenance. Usually temporary.
504Gateway TimeoutOne server waited too long for another server to answer.

Fun fact: 418 I'm a teapot began as an April Fools' joke in 1998, in a spoof standard for controlling coffee pots over the internet. It's not part of the official HTTP standard, but plenty of websites still answer with it as an Easter egg. And 451 Unavailable For Legal Reasons, used when content is blocked for legal reasons, is a nod to Ray Bradbury's novel Fahrenheit 451.

Redirects up close

Redirects deserve a closer look, because they're behind every shortened link. When you click a link like bit.ly/3kQx7Zp, the shortener replies with a 3xx code and a Location header containing the real address:

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com.au/recipes/pavlova

Your browser then makes a brand-new request to that address and, all being well, gets a 200 OK.

Permanent or temporary?

CodeTypeBrowser may change the request?Typical use
301PermanentYes, sometimesA page or whole site has moved for good
302TemporaryYes, sometimesA short-term detour, e.g. during a sale
307TemporaryNoTemporary moves where a form submission must be kept intact
308PermanentNoPermanent moves where a form submission must be kept intact

"Change the request" refers to an old quirk: with 301 and 302, browsers may turn a form submission into a plain page load when following the redirect. The newer 307 and 308 were created to forbid that. For everyday web pages, 301 and 302 are fine.

The difference between permanent and temporary matters to search engines such as Google. A permanent redirect tells them to update their records to the new address, while a temporary one tells them to keep the old address in mind.

Redirect chains

Sometimes one redirect leads to another, and another, before you reach the final page. This is a redirect chain. For example, a short link might redirect to a tracking service, which redirects to http://, which redirects to https://. Chains slow pages down, and if a chain loops back on itself, your browser gives up with an error such as "too many redirects".

If you want to see every step a link takes before you click it, a link expander such as ExpandURL follows the redirects for you and shows where the chain ends. That's also a handy way to check a suspicious short link safely.

How to see a status code yourself

Browsers hide status codes unless something goes wrong, but you can easily look for yourself using your browser's developer tools, a built-in panel for inspecting web pages.

  1. Open the developer tools. In Chrome, Edge or Firefox on Windows, press F12 or Ctrl + Shift + I. On a Mac, press Cmd + Option + I. (In Safari, first turn on the Develop menu in Settings, under Advanced.)
  2. Click the Network tab.
  3. Reload the page with F5 or Cmd + R.
  4. Look at the Status column. The first row is the page itself; the rest are images, scripts and other files it loaded. Click any row for details, including headers.

You'll often see a mix of 200, 304 and the odd redirect. A 404 on an image explains why a picture is missing.

From the command line

If you're comfortable with a terminal, the free curl tool (built into Windows, macOS and Linux) shows just the status line and headers. The -I option asks for headers only:

curl -I https://www.example.com.au/old-page

HTTP/1.1 301 Moved Permanently
Location: https://www.example.com.au/new-page

Add -L (curl -IL) to follow each redirect and see every step of the chain.

Troubleshooting by status code

The code tells you where to start. Here's what you can try as a visitor, and what to check if it's your own website.

CodeAs a visitor, try…If it's your site, check…
400Retyping the address; clearing the site's cookiesMalformed links, oversized cookies or form data
401Logging in (or logging out and back in)Login sessions and authentication settings
403Checking you're in the right account; contacting the siteFile permissions, security rules, blocked regions or IP addresses
404Checking for typos; using the site's search; going to the home pageBroken internal links; add 301 redirects for moved pages
429Waiting a few minutes before trying againRate-limit settings; bots hammering the site
500Refreshing; trying again laterServer error logs; recent code or plugin changes
502 / 504Refreshing after a minute or twoWhether the application server or database is running or overloaded
503Waiting; checking the site's social media for maintenance noticesMaintenance mode, traffic spikes, hosting limits

Problems codes don't always reveal

  • "Soft 404s": some sites show a "page not found" message but send a 200 OK code. It looks like an error to you but like a normal page to search engines. Site owners should make sure missing pages really return 404.
  • "Too many redirects": this browser error means a redirect loop. Clearing the site's cookies sometimes fixes it; otherwise it's the site owner's job.
  • Error pages that hide the code: many sites show friendly custom error pages. Developer tools will still show the real code.

Key rule: 4xx usually means "change something about the request"; 5xx usually means "the website needs to fix something". If you get a 5xx, waiting and retrying is often all you can do.

Quick reference table

CodeNameIn plain words
200OKIt worked.
301Moved PermanentlyIt's moved for good; follow me.
302FoundIt's temporarily elsewhere; follow me.
304Not ModifiedUse your saved copy.
307Temporary RedirectTemporarily elsewhere; keep the request exactly the same.
308Permanent RedirectMoved for good; keep the request exactly the same.
400Bad RequestI don't understand the request.
401UnauthorizedWho are you? Please log in.
403ForbiddenI know who you are, and the answer's no.
404Not FoundNothing here.
410GoneIt was here, and it's been removed for good.
429Too Many RequestsSlow down.
500Internal Server ErrorSomething broke on our end.
502Bad GatewayA server behind me gave a bad answer.
503Service UnavailableToo busy or down for maintenance.
504Gateway TimeoutA server behind me took too long.

For the full list of codes, see CSSPortal HTTP Status Codes.

Wrapping up

HTTP status codes are the web's way of reporting back on every request. Most of the time they're invisible, quietly saying 200 OK. When something goes wrong, the code points you straight towards the cause.

If you remember four things, make them these:

  1. The first digit tells you the family: 2xx success, 3xx redirect, 4xx request problem, 5xx server problem.
  2. 401 means "please log in"; 403 means "you're not allowed, even if you do".
  3. 301 and 302 redirects power shortened links, and your browser follows them silently.
  4. You can see any page's status code in your browser's developer tools, under the Network tab.

Next time an error page appears, read the number first. It's telling you more than you might think.

We noticed you're using an ad blocker - no worries! Visit our Support Page to help keep it free for everyone.