Why 404? The History of HTTP Status Codes
Where the web's three-digit codes came from, why 404 means not found, how a joke about coffee pots became permanent, and why 402 Payment Required waited thirty years.
· 9 min read
Every time your browser loads a page, the server's reply begins with a three-digit number. Almost always it's 200, and you never see it. Occasionally it's 404, and you do. That one number has become so familiar that "404" is slang for something missing, printed on T-shirts and used by people who have never opened a terminal.
The codes are older than the web. They were borrowed from a file transfer protocol written in the 1970s, and the list has grown through bug fixes, browser workarounds, one April Fools' joke, a book about burning books and a payment system that took three decades to show up. Here is how a few dozen numbers came to describe nearly everything that can go right or wrong on the internet.
The web started without them
The first version of HTTP, which Tim Berners-Lee ran at CERN in 1991 and which is now called HTTP/0.9, was about as simple as a protocol can be. A browser opened a connection and sent one line:
GET /hypertext/WWW/TheProject.html
The server sent back the HTML and closed the connection. There were no headers, no content types and no status. If the page didn't exist, the server sent back a page of HTML saying so. The specification admitted that a program had no way to tell an error message from a real document except by reading the text.
That was fine while people were the only readers. It stopped being fine as soon as software needed to make decisions: a cache deciding whether to keep a response, a crawler deciding whether a link was dead, a browser deciding whether to ask for a password. They all needed a reply that a machine could understand without parsing English.
Borrowed from FTP
The solution already existed. Since the early 1970s, the internet's file transfer protocol had answered every command with a three-digit number followed by a line of text. Jon Postel tidied the scheme up in RFC 640 in 1974, and the mail protocol SMTP adopted it in 1982. The text was for people. The number was for programs, and its first digit carried most of the meaning: 2 for success, 3 for "send more", 4 for a temporary failure, 5 for a permanent one.
When Berners-Lee drafted the next version of HTTP in 1992, he took the same shape. The response would now start with a status line:
HTTP/1.0 404 Not Found
The first digit kept the role of a class, but HTTP gave the classes its own meanings. 2xx meant success, 3xx meant look elsewhere, 4xx meant the client had made a mistake and 5xx meant the server had. The important property came with it: a program only needed to understand the first digit. A client that receives a code it has never heard of is still required today to treat it as the x00 code of its class, so an unknown 599 is handled like 500. That one rule is why the list has been able to grow for thirty years without breaking anything.
The early lists look slightly odd now. They included 203 Partial Information, 204 No Response and 303 Method, a 402 that expected the client to retry with a ChargeTo header, and a 5xx group in which 502 meant "service temporarily overloaded" and 503 meant "gateway timeout". The numbers were rearranged before anything was formally published. RFC 1945, the HTTP/1.0 document, came out in May 1996, and HTTP/1.1 followed in January 1997 and was revised in 1999. Most of the core codes in use today were settled in those three documents.
So why 404?
There's a popular story that the web's first servers sat in room 404 at CERN, and that the error was named after the office. It's a good story, but it doesn't need to be true, because the number follows directly from the scheme. The 4 says the problem is on the client's side: you asked for something that isn't there. The 04 is just its place in the list, after 400 Bad Request, 401 Unauthorized, 402 Payment Required and 403 Forbidden.
What made 404 famous wasn't the number but how often people saw it. Links on the early web pointed at files on someone's university account, and when the student graduated or the file moved, the link broke. Servers showed a bare grey page with "404 Not Found" at the top, millions of people saw it, and the number stuck. Sites later started designing their own 404 pages, and some became small attractions in their own right.
One mistake from that era still causes trouble. Some sites show a friendly "page not found" message but send it with a status of 200, so the page looks like an error to people and like a real page to software. Google calls this a soft 404, and it is still one of the common problems search engines report to site owners.
Look up what any status code meansLook up any HTTP status code — every IANA-registered code plus nginx and Cloudflare's unofficial ones — with what it means, what causes it, how to fix it, and whether to retry.The 302 problem
Redirects were where the numbers and real behaviour first came apart.
HTTP/1.0 defined 301 Moved Permanently and 302 Moved Temporarily, and said that a client following one should repeat the same request at the new address. If you submitted a form with POST and got a 302, the browser was supposed to POST again to the new URL. Browsers didn't. Almost all of them switched to GET, partly because re-sending form data without asking seemed risky. So many sites came to depend on that behaviour that it could no longer be changed.
HTTP/1.1 dealt with it by splitting the two meanings apart. 302 was renamed Found and left as it was, inconsistencies and all. 303 See Other was defined for "go and GET this other page", which is what browsers were already doing, and is still the clean way to send someone to a results page after a form submission. 307 Temporary Redirect was added for "repeat exactly the same request over there". The permanent version took longer: 308 Permanent Redirect arrived in 2014 and became a full standard in 2015.
Code 306 sits in the middle of all this, unused. It was briefly "Switch Proxy" in a draft, was dropped, and has been reserved ever since so it can't be given a different meaning.
Write 301 and 308 redirects for nginxGenerate commented nginx config for single-path, domain, HTTP-to-HTTPS, www, trailing-slash, and bulk redirects.402: thirty years on hold
In the 1992 list, 402 Payment Required was a real plan. A server could reply 402 with a description of how it accepted payment, and the client could try again with payment details attached. Early web developers expected small payments to become a normal part of browsing.
They didn't, at least not in that form. Payments ended up on checkout pages, run by companies rather than built into the protocol, and 402 was marked "reserved for future use" in HTTP/1.1. It kept that label through every revision, including RFC 9110 in 2022. Some APIs adopted it informally. Stripe, for example, returns 402 when a card is declined.
The code has recently found a use close to the original one. In 2025, Coinbase published a proposal called x402 for software agents to pay for API calls per request, and Cloudflare began testing a "pay per crawl" scheme that sends 402 to AI crawlers that haven't agreed to pay. Neither is part of the HTTP standard, but both use 402 for what it was originally meant for, which no other code had done in more than thirty years.
The teapot that stayed
On 1 April 1998, Larry Masinter published RFC 2324, the Hyper Text Coffee Pot Control Protocol. It was a joke aimed at the many ways people were extending HTTP for unrelated jobs. It added a BREW method, headers for milk and syrup, and one new error: 418 I'm a teapot, for a server asked to brew coffee when it can only make tea.
Programmers liked it. Web frameworks, HTTP libraries and testing tools added 418 as an Easter egg, and Google served a teapot page that returned it. That became a problem in 2017, when Mark Nottingham, chair of the IETF's HTTP working group, asked projects including Node.js and Go to remove 418. His reasoning was that a joke code occupying a real slot in the 4xx range might stop it being assigned a real meaning later.
The response was immediate. Developers started a "Save 418" campaign, the issue threads filled with objections, and the projects kept the code. The standards process eventually agreed. When RFC 9110 rewrote the HTTP specification in 2022, it listed 418 as "(Unused)" and reserved it, on the grounds that the joke had been implemented so widely that the number was effectively taken. The teapot can't be given any other meaning now.
How the list grew
Most of the codes added since 1999 came from specific problems, often ones that sites had already worked around with codes of their own.
| Code | Added | Why |
|---|---|---|
| 207 Multi-Status, 422, 423, 424 | 1999 | WebDAV, for editing files over HTTP, needed more detailed answers |
| 426 Upgrade Required | 2000 | Telling a client to switch protocols, at first to TLS |
| 428, 429 Too Many Requests, 431, 511 | 2012 | Rate limits, oversized headers and Wi-Fi login pages all needed a code |
| 308 Permanent Redirect | 2014 | The method-preserving permanent redirect HTTP/1.1 hadn't included |
| 421 Misdirected Request | 2015 | HTTP/2 reuses connections, so a request can arrive at the wrong server |
| 451 Unavailable For Legal Reasons | 2016 | Content blocked by courts or governments, named after Fahrenheit 451 |
| 103 Early Hints | 2017 | Lets a server tell the browser to start loading CSS before the page is done |
| 425 Too Early | 2018 | TLS 1.3 early data can be replayed, so servers needed a way to refuse it |
Before 429 existed, Twitter's API returned its own 420 Enhance Your Calm to clients that were sending too many requests. It's a good example of how the system is meant to work: a vendor invented a code, clients that didn't recognise it treated it as a generic 400, and when the standard caught up, everyone moved over.
Some codes were renamed along the way. RFC 9110 moved 422 out of WebDAV and into the core standard as Unprocessable Content, because APIs everywhere were already using it for validation errors, and 413 Request Entity Too Large became Content Too Large.
Codes nobody standardised
The x00 fallback also lets software invent codes freely, and plenty does. nginx logs 499 Client Closed Request when a client hangs up before the response is ready, and uses 444 as an instruction to close the connection without sending anything. Cloudflare reports problems with the server behind it as 520 to 527: 521 when the origin refuses the connection, 522 when it times out, 524 when it connects but takes more than 100 seconds to answer.
None of these are in the official registry, and some are never sent to a client at all. They still work, for the reason Postel's scheme was designed around in 1974: any program that only understands the first digit still knows whether the problem is on the client side or the server side.
The words fell away
In HTTP/1.1, the text after the number, the "Not Found" in 404 Not Found, was always optional, and clients were told to ignore it. HTTP/2, published in 2015, removed it completely. A response now carries a single field:
:status: 404
HTTP/3 does the same. The reason phrases still appear in documentation and in browser developer tools, but they no longer travel over the network. The number on its own is the protocol.
When an API needs to explain what went wrong in more detail, the convention now is to put a structured body after the code. RFC 7807 in 2016, revised as RFC 9457 in 2023, defined Problem Details, a small JSON format with fields for a type, a title, the status and a human-readable detail. The status code still gives the category, and the body explains the specific case.
Inspect the headers that come with a responsePaste raw HTTP headers and get a clean breakdown with explanations of common headers, security headers, and cookies.Three digits, still enough
The status codes have outlasted HTTP/0.9, the original browsers, the text after the number and the idea of paying for pages through the protocol. They survived a decade of browsers ignoring the redirect rules and a campaign to delete a joke. They work because the original design asked for very little: three digits, with the first one carrying most of the meaning.
Each new version of HTTP has changed how the bytes travel, but every one has kept the codes. A 404 today means what it meant in 1992.
Browse every HTTP status codeLook up any HTTP status code — every IANA-registered code plus nginx and Cloudflare's unofficial ones — with what it means, what causes it, how to fix it, and whether to retry.