HTTP Error 431: What It Means and How to Fix It Fast

You click a link, wait a second, and instead of the page you expected, the browser shows a plain error: 431 Request Header Fields Too Large. Nothing looks broken on your side. The internet works, other websites load fine, and the same page might have worked yesterday. So what changed?
The short answer is that the request your browser sent to the server carried too much baggage. Every time a browser asks a server for a page, it sends a set of headers along with the request — small pieces of information such as cookies, the address of the page you came from, and details about your browser. Normally these headers are tiny. But they can grow, quietly, over weeks and months, until one day they cross a limit the server has set. When that happens, the server refuses the request outright and sends back a 431.
This article explains what HTTP Error 431 actually means, why it shows up, how it differs from the errors it is often confused with, and how to fix it — whether you are simply trying to open a website or you are the person responsible for keeping that website running.
What Is HTTP Error 431?
HTTP Error 431, formally called “431 Request Header Fields Too Large,” is a client error status code. It tells you that the server refused to process your request because one or more of the header fields in that request were too large.
The code was introduced in RFC 6585, published in April 2012. That document added several new HTTP status codes for situations that the original HTTP specification did not cover well. The 431 code was created specifically for the case where the combined size of the request headers, or the size of a single header field, exceeds what the server is willing to accept.
To understand why this matters, it helps to know what a header is. When your browser requests a web page, it does not just ask for the page. It sends a short block of text at the top of the request, made up of individual header fields. Each field has a name and a value. Common ones include:
- Cookie: the cookies your browser has stored for that website.
- User-Agent: a string identifying your browser and operating system.
- Referer: the address of the page you clicked from.
- Accept: the types of content your browser can handle.
- Authorization: credentials or tokens, often used when you are signed in to a service.
The server reads these headers before it even looks at the page you asked for. If the headers are too big, the server gives up early and returns 431 instead of the page.
The key point is that a 431 is about the request, not the page itself. The page may be perfectly fine. The problem is the size of the information travelling with the request.
What Causes HTTP Error 431?
A 431 rarely appears out of nowhere. Something has been adding weight to your requests, usually gradually. These are the most common causes.
Cookies piling up
This is the cause behind most 431 errors that ordinary visitors run into. Websites store cookies in your browser, and many sites store several of them. A single cookie is usually small, but they add up. Some sites set a new cookie on almost every visit, or store a large amount of data in a cookie instead of on the server.
Over time, the total size of the cookies for one domain can grow to several kilobytes. The browser sends every cookie for that domain with every single request to it — every page, every image, every stylesheet. Once the total crosses the server’s limit, the next request fails with a 431, even though the previous one worked.
Localhost development is a classic example of this. Developers testing a site on their own machine often accumulate dozens of cookies for localhost from different projects, and because all of them share the same host, the browser sends them all at once. A 431 on localhost almost always means the cookie pile has grown too big.
A single oversized header
Sometimes the problem is not the total, but one individual header that is far too large. The most common offender is the Authorization header. Modern web applications often use JSON Web Tokens, known as JWTs, to keep users signed in. A JWT carries information about the user inside the token itself, and that information can make the token very long — especially if it contains roles, permissions, or group memberships.
When a token like that is sent in the Authorization header on every request, a single header field can be several kilobytes on its own. Add a normal set of cookies on top, and the server’s limit is exceeded.
Long Referer URLs
The Referer header tells the server which page you came from. Usually it is a normal web address. But if the page you came from has a very long URL — for example, a search results page with dozens of tracking parameters, or a link from an email campaign with a long chain of parameters — the Referer header itself becomes long. On its own it rarely causes a 431, but combined with a healthy set of cookies it can be the final straw.
Proxy chains appending headers
In many company networks and some hosting setups, a request passes through one or more proxies before it reaches the actual web server. Each proxy can add its own headers, such as X-Forwarded-For, to record where the request came from. With several proxies in a chain, the headers grow with each hop. A request that starts out at a reasonable size can arrive at the server noticeably larger, and if the server’s limits are tight, it gets rejected with a 431.
Large cookies set by the site itself
Some websites store more data in cookies than they should. A common mistake is putting an entire user profile, a shopping basket, or a long list of preferences into a cookie. Cookies were designed for small pieces of data, like a session identifier. When a site treats them as a general storage area, the cookies grow, every request to that site gets heavier, and eventually some users start seeing 431 errors — often only the most active users, because they are the ones with the most data stored.
How 431 Differs From 400, 413, and 414
HTTP Error 431 is often confused with three other client error codes, because all of them involve a request the server will not accept. They are not the same, and telling them apart points you toward the right fix.
| Status code | Name | What it means |
|---|---|---|
| 400 | Bad Request | The request itself is malformed — the server cannot understand it at all. |
| 431 | Request Header Fields Too Large | The request is well-formed, but the headers are too large. |
| 413 | Content Too Large | The body of the request is too large — the data you are sending, such as an uploaded file. |
| 414 | URI Too Long | The web address (URL) in the request is too long. |
A 400 means something in the request is broken or unreadable. A 431 means the request is fine in structure, but its headers exceed a size limit. A 413 is about the body of the request, not the headers — it usually appears when you try to upload a file that is too big. A 414 is specifically about the URL being too long.
This distinction matters in practice. If you see a 431, clearing your cookies or reducing header size is the fix. If you see a 413, the problem is the file or data you are uploading. Treating one like the other wastes time.
How to Diagnose HTTP Error 431
Before fixing anything, it is worth confirming which header is causing the trouble. A few minutes of checking can save a lot of guessing.
Check whether it is only one site
The simplest diagnostic step is also the most useful. If the 431 appears on only one website while everything else loads normally, the problem is almost certainly tied to that site — usually its cookies in your browser. If it appears on many different sites, the cause is more likely something on your end, such as a browser extension adding large headers to every request, or a proxy on your network.
Use the browser’s developer tools
Every modern browser has developer tools built in. Open them with F12 or Ctrl+Shift+I, go to the Network tab, and reload the page. Click on the failed request and look at the Request Headers section. You can see each header and get a sense of which ones are unusually large. A Cookie header that runs to several lines of text, or an Authorization header that fills the panel, is a strong clue.
Use curl to inspect the headers
If you are comfortable with the command line, curl can show you exactly what is being sent. Running curl -sv against the URL prints the request headers as they go out, so you can see their size and content. This is especially useful for developers, because it removes the browser from the picture entirely — if the same request fails from curl, the problem is in the headers themselves, not in a browser setting.
Try a private window
Opening the same page in a private or incognito window is a quick test. A private window starts with no cookies for the site and no extensions running, so if the page loads there, you have confirmed that the cause is either stored cookies or an extension in your normal browsing session.
How to Fix HTTP Error 431 as a Visitor
If you are just trying to open a website and you meet a 431, start with the simplest fixes. In most cases one of these solves it within a minute.
1. Clear cookies for that site only
This is the fix that works most often, and it is also the least disruptive. You do not need to wipe all of your cookies — that would sign you out of every website. Instead, clear the cookies for the one site that is showing the error.
In Chrome, click the padlock or tune icon in the address bar, open the site settings, and remove the cookies for that domain. In Firefox, open the site’s settings from the padlock icon and choose “Clear Cookies and Site Data” for that site. Then reload the page. If oversized cookies were the cause, the page will load, and the site will set fresh, small cookies as you use it.
2. Try a private or incognito window
If clearing cookies feels like too much hassle, open a private window and try the page there. A private window has no stored cookies for the site, so the request goes out with minimal headers. If the page loads, you know the problem is in your stored cookies, and you can clear them at your convenience.
3. Disable browser extensions that modify requests
Some extensions add their own headers to requests — ad blockers, privacy tools, and developer tools are common examples. Try disabling your extensions one at a time, or turn them all off temporarily and reload the page. If the error disappears, turn them back on one by one until you find the one responsible. You can then either leave it off for that site or check its settings for an option that reduces what it adds to requests.
4. Try a different browser or device
This is a useful check rather than a permanent fix. If the page loads in a different browser, or on your phone, the problem is specific to your usual browser’s stored data — again, most likely cookies. It also gets you to the page you need right now while you sort out the underlying issue.
5. Sign out and sign back in
If the site keeps you signed in with a large token, signing out and signing back in can help. Signing out usually clears the old session cookies, and signing back in creates a fresh, smaller set. This is worth trying if the error appears only when you are signed in to a particular service.
How to Fix HTTP Error 431 as a Website Owner or Developer
If you run the website, a 431 is your problem to solve, because your visitors cannot fix it for you. The right approach is to reduce the size of the headers your site creates, and only then consider raising the server’s limits.
Keep cookies small and scoped
The most effective server-side fix is also the simplest: store less data in cookies. A cookie should hold a short session identifier, not a user’s profile or preferences. The actual data belongs on the server, looked up by that identifier. This is what “store session IDs server-side” means in practice — the cookie carries a short random string, and everything else lives in your database or session store.
Scoping matters too. Set cookies only for the paths and subdomains that actually need them. A cookie set for the whole domain gets sent with every request to every part of the site, including requests for images and stylesheets. A cookie scoped to a single path, such as the account area, only travels where it is needed.
Check for duplicate or stale cookies
If your application sets a new cookie every time a user visits, instead of updating the existing one, duplicates accumulate. Audit the cookies your site sets and make sure each one has a clear purpose, a sensible expiry time, and a single current value. Expired or redundant cookies are pure weight on every request.
Raise server limits carefully
Sometimes the headers are legitimately large — a long authentication token, for example — and the server’s default limit is simply too tight. In that case you can raise the limit, but do it deliberately, and only after you have trimmed what you can. Raising limits without fixing the underlying bloat just postpones the problem, and very large headers cost the server memory and processing time on every request.
The defaults vary by server software:
- Node.js has a default maximum header size of 16 KB. It can be raised with the –max-http-header-size command-line flag, or by setting the maxHeaderSize option when creating an HTTP server.
- nginx uses the large_client_header_buffers directive, which defaults to 4 buffers of 8 KB each.
- Apache uses LimitRequestFieldSize, which defaults to 8190 bytes per header field.
- Go’s standard HTTP server has a MaxHeaderBytes setting that controls how large request headers may be.
- IIS exposes MaxFieldLength and MaxRequestBytes settings for the same purpose.
Whichever server you use, change the limit in small steps and test afterwards. A modest increase that covers legitimate traffic is the goal — not an unlimited ceiling.
Watch for proxy-added headers
If your site sits behind a proxy or a load balancer, check what headers the proxy adds. Each one costs space. Some setups add several forwarding headers on every request. If you control the proxy, remove the ones your application does not use, and make sure the proxy is not duplicating headers that are already present.
Test with realistic traffic
A 431 often appears only for your most active users, because they are the ones with the most cookies and the longest tokens. Test with accounts that have been used for a while, not just fresh test accounts. If a long-standing account triggers the error, your cookie and token sizes need attention.
Common Mistakes That Make 431 Worse
A few habits turn an occasional 431 into a regular problem. Avoiding them costs nothing and prevents most recurrences.
First, storing user data in cookies instead of on the server. It feels convenient during development, but it makes every request heavier and eventually breaks for your heaviest users.
Second, setting cookies without an expiry or with a very long lifetime. Cookies that never expire accumulate indefinitely. Give each cookie a reasonable lifetime and clean up old ones.
Third, adding more tracking parameters to URLs. Long URLs produce long Referer headers, and those headers travel with the next request. Keep tracking parameters as short as they can be.
Fourth, raising the server limit as the first response. It hides the symptom while the real problem — growing headers — continues. Trim first, then raise the limit only if legitimate traffic still needs the room.
When to Contact the Site Owner or Hosting Provider
Sometimes there is nothing you can do from your side. If you have cleared the site’s cookies, tried a private window, disabled your extensions, and tried another browser, and the 431 still appears, the problem is on the server’s end. The site may be setting oversized cookies, or its server limits may be set too low.
In that case, contact the site’s support team or use its contact form and describe what you tried. Mention that the error is a 431, that it happens on every browser you tried, and that clearing cookies did not help. That information points the site’s developers straight at the cause.
If you are the site owner and the error appears for many visitors at once, talk to your hosting provider. A sudden wave of 431 errors can mean a recent change on the server — a new proxy, a changed limit, or a software update — and your host can tell you what changed and how to adjust it.
Frequently Asked Questions
What does HTTP Error 431 mean?
HTTP Error 431 means the server refused your request because the headers attached to it were too large. Headers are the extra pieces of information your browser sends with every request, such as cookies and authentication tokens. When they grow past a limit set by the server, the server rejects the request and returns a 431 instead of the page.
Is HTTP Error 431 caused by my internet connection?
No. A 431 has nothing to do with your internet speed or connection quality. It is caused by the size of the request headers — usually cookies stored in your browser or a large authentication token. Your connection can be perfectly fine while a 431 still appears.
Will clearing all my cookies fix a 431 error?
Clearing the cookies for the affected site usually fixes it, because oversized cookies are the most common cause. You do not need to clear cookies for every website — just the one showing the error. That keeps you signed in everywhere else.
What is the difference between HTTP 431 and HTTP 413?
A 431 means the headers of the request are too large. A 413, “Content Too Large,” means the body of the request is too large — for example, a file you are trying to upload. They are different problems with different fixes: a 431 is fixed by reducing header size, while a 413 is fixed by reducing the size of what you are sending.
Can a 431 error appear on localhost during development?
Yes, and it is common. Development machines accumulate many cookies for localhost from different projects, and the browser sends them all with every request to localhost. Clearing the localhost cookies in your browser almost always fixes it.
Conclusion
HTTP Error 431 looks alarming, but it has a simple meaning: the headers on the request were too large for the server to accept. Most of the time the cause is cookies that have grown over months of browsing, or a single oversized header such as a long authentication token. For visitors, the fix is usually quick — clear the cookies for that one site, try a private window, or check whether an extension is adding weight to requests.
For website owners, the lasting fix is to keep headers lean: store session data on the server and keep only a short identifier in the cookie, scope cookies to where they are needed, and raise server limits only after trimming what can be trimmed. A 431 is a useful warning sign. It tells you that requests are carrying more weight than they should, and dealing with the cause makes the site faster and more reliable for everyone who visits it.
Read Also: How to Close HTTP Menu Roblox: Player and Developer Fixes




