HTTP 503 and 401 Errors: One Means Wait, the Other Means You Have to Act
HTTP error 503 means the server is temporarily unable to handle your request, so you wait. HTTP 401 means the request lacks valid credentials, so you sign in. Here is what RFC 9110 says each one means, and what a visitor and a site owner should each do.

Key takeaways
- HTTP 503 Service Unavailable means the server is currently unable to handle the request because of a temporary overload or scheduled maintenance, and RFC 9110 (June 2022) says the condition will likely clear after some delay.
- HTTP 401 Unauthorized means the request lacks valid authentication credentials for the target resource, and the server must send a WWW-Authenticate header naming at least one way to log in.
- A 503 is the one common error a visitor cannot fix, because the fault is on the server, while a 401 is the one a visitor is expected to fix by supplying or correcting credentials.
- A site owner doing planned maintenance should return 503 with a Retry-After header, such as Retry-After: 120 for two minutes, rather than a 200 page or a 404.
- A 403 Forbidden differs from a 401 because the server understood the request and refuses it, so repeating it with the same credentials will not help.
HTTP error 503 means the server is temporarily unable to handle your request, either because it's overloaded or because someone took it down for maintenance.[1] HTTP 401 means your request didn't include valid credentials, so you need to sign in or sign in again.[1] One is the server's problem. The other is yours.
That split is the useful part, and most explainers bury it. When a page fails, the first question isn't “what does the number mean.” It's “who has to do something next.” With a 503 the answer is the site's owner. With a 401 it's you.
The numbers come from HTTP, the protocol browsers and servers use to talk, which I walked through in HTTP vs HTTPS.
Every response starts with a three-digit status code, and the rulebook for what each one means is RFC 9110, published by the Internet Engineering Task Force (IETF) in June 2022 as Internet Standard 97.[1] Everything below quotes that document, not a blog's memory of it.
503 means the server is temporarily unable to help
The wording in RFC 9110 is precise. A 503 (Service Unavailable) indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.[1] Two causes, both temporary, and the standard expects the problem to go away on its own.
The server may also send a Retry-After header suggesting how long to wait. The value is either a date or a number of seconds, and the RFC's own example is Retry-After: 120, which it describes as a two-minute delay.[2]
HTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: text/html
<h1>Back in a couple of minutes</h1>There's a footnote in the RFC I like. The existence of 503 doesn't mean a server has to use it when overloaded, and some servers refuse the connection outright.[1] So an overloaded site might show you a polite 503 page, or a blank browser error, or nothing. The code is a courtesy, not a guarantee.
If you're a visitor
Wait two minutes and reload once. That's the honest fix. You can't repair a server from your laptop, and mashing refresh adds load to a machine that's already struggling.
If you want to know whether it's down for everyone, load the page on your phone using mobile data. Same error there means it isn't you.
If you run the site
Return 503 on purpose when you're taking the site down, and send Retry-After with it. That tells browsers, API clients and search crawlers the outage is temporary. A 200 with a “back soon” page tells them the opposite, that this is the content.
Google backs this up. Its crawlers slow down when they meet 5xx responses, and URLs that were already indexed are preserved, but URLs that persistently return a server error are eventually dropped. Google doesn't say how many days that takes, so a week-long 503 is a gamble.[3] Keep it short.
And check which error you're really looking at. A gateway or proxy that can't get a valid answer from the server behind it returns 502 (Bad Gateway), and one that doesn't get a timely answer returns 504 (Gateway Timeout).[1]
If you sit behind a content delivery network, as covered in what a CDN is, the error page may be coming from the CDN's edge rather than your origin. That changes where you look.
401 means the request isn't authenticated
Here the name misleads you. 401 is labeled “Unauthorized,” but the definition is about authentication, which is proving who you are. RFC 9110 says the request has not been applied because it lacks valid authentication credentials for the target resource.[1]
What I find clever about the design is the requirement attached to it. A server sending a 401 must include a WWW-Authenticate header containing at least one challenge, meaning a description of how to log in.[1] The error isn't a dead end. It's a door with a sign saying which key fits.
How a 401 works
The server asks, the client answers, and a wrong answer gets the same question back
Client sends
- A request with no credentialsOr with expired or wrong ones.
401 plus a WWW-Authenticate challenge
The server names the login scheme it accepts.
Client does next
- Repeats the request with an Authorization headerA browser shows a login prompt; an app sends a token.
- Gets the same challenge againThe credentials were refused, so show the error to the user.
Based on RFC 9110 sections 11.6.1, 15.5.2 and 15.5.4.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="staging"The RFC adds a rule for the retry. If the request included credentials, a 401 means they were refused. The client may try again with new ones, but if the same challenge comes back after an attempt, it should show the user the error page, since that page usually carries diagnostic information.[1]
If you're a visitor
Sign in. If you already did, assume the session or token expired: log out, log back in, and retype the password rather than trusting autofill.
If a browser pops up a plain username-and-password box before the page even loads, that's the Basic scheme from the example above, and the credentials come from whoever runs that site, not from your account elsewhere.
If you run the site
Three things cause most accidental 401s in my experience. A password prompt left on a staging site that went public. A proxy or load balancer that drops the Authorization header before it reaches your app.
A token that expired and a client that never refreshes it. For anything that is an API, the failure modes get broader, and the OWASP API security guide covers the authentication mistakes behind them.
Heads up
401 and 403 are not the same thing
They get swapped constantly. A 403 (Forbidden) means the server understood the request and refuses to fulfill it. If you sent credentials, the server considers them insufficient, and the client shouldn't automatically repeat the request with the same ones.[1]
The short version: 401 is “who are you,” and 403 is “I know who you are, and no.”
One more detail that surprises people. A server that wants to hide that a protected resource exists may answer 404 instead of 403.[1] So a “Not Found” on a page you're sure exists can be a permissions answer in disguise.
Which error, who acts, what they do
| Code | RFC 9110 meaning | Who acts | First move |
|---|---|---|---|
| 401 | Missing or invalid credentials | The visitor | Sign in again, with correct details |
| 403 | Understood, but refused | The site owner, or an admin | Ask for access; do not retry the same credentials |
| 502 | Gateway got an invalid response upstream | The site owner | Check the server behind the proxy |
| 503 | Temporary overload or maintenance | The site owner | Visitor waits; owner restores capacity |
| 504 | Gateway timed out waiting upstream | The site owner | Find the slow upstream service |
“A 503 is the server asking you to wait. A 401 is the server asking you to prove who you are. Only one of those is yours to fix.”
Takeaway
Read the first digit first. A 4xx means the request needs to change, and a 5xx means the server has to change. A 503 is a request to wait, a 401 is a request to log in, and sending the right one for planned downtime is how you keep search engines and API clients calm.
What I'd actually do
If I'm the visitor and see a 503, I close the tab and come back in five minutes. If I see a 401, I log out and in again before I touch anything else.
If I'm the owner, I treat every status code as a message to a machine, and I put a real Retry-After on every maintenance page I ship.
The codes look like noise until you remember a person designed them to answer one question, and it's the one you ask when a page breaks: what do I do now?
Primary sources
- 1.PrimaryIETF, RFC 9110, "HTTP Semantics" (STD 97, June 2022). Sections 10.2.3 (Retry-After), 11.6.1 (WWW-Authenticate), 15.5.2 (401), 15.5.4 (403), 15.6.3 to 15.6.5 (502, 503, 504).
- 2.PrimaryIETF, RFC 9110, section 10.2.3, "Retry-After". A date or a number of seconds; Retry-After: 120 is a two-minute delay.
- 3.PrimaryGoogle Search Central, "HTTP status codes, network and DNS errors". How Googlebot treats 4xx, 429 and 5xx responses, and why 401 and 403 are not for crawl control.
Frequently asked questions
- What does HTTP error 503 mean?
- HTTP error 503 Service Unavailable means the server is currently unable to handle your request because of a temporary overload or scheduled maintenance. RFC 9110 says the condition will likely be alleviated after some delay. It is a server-side problem, so nothing on your device is broken.
- How do I fix a 503 error as a visitor?
- You mostly can't, because the fault is on the server. Wait a couple of minutes and reload once. If the server sent a Retry-After header, that tells your client how long to wait. Reloading repeatedly adds to the overload. If the site stays down, check whether it is down for everyone by trying another network or device.
- What does HTTP 401 mean?
- HTTP 401 Unauthorized means the request has not been applied because it lacks valid authentication credentials for the target resource. Despite the name, it is about authentication, who you are, not permission. The server must send a WWW-Authenticate header describing how to log in.
- How do I fix a 401 error?
- Sign in, or sign in again, with the correct credentials. If you already did, your session or token has probably expired or been rejected, so log out and back in. RFC 9110 says that if the same challenge comes back after you tried credentials, the server has refused those credentials. As a site owner, check that the Authorization header reaches your application and has not been stripped by a proxy.
- What's the difference between 401 and 403?
- A 401 says you haven't proven who you are, and trying again with valid credentials can work. A 403 says the server understood the request and refuses it, and RFC 9110 says the client should not automatically repeat it with the same credentials. A server may also answer 404 instead of 403 to hide that a resource exists.
- Does a 503 hurt SEO?
- A short 503 is the right signal for planned downtime, because Google's crawlers slow down on 5xx responses and keep already indexed URLs. Google says URLs that persistently return a server error are eventually dropped from the index, and it gives no specific number of days. A 401 or 403 is treated like any other 4xx and the URL is removed from the index.
Written by
Tech Talk News Editorial
Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.
More about the author