Host Your Own AI Agent with OpenClaw - Free 1-Click Setup!

HTTP Error 431: How to Diagnose and Fix It

You’re visiting a site — or running one — and instead of content, the browser returns a bare error page with no explanation. HTTP error 431 is one of the quieter HTTP status codes, but it has a clear cause and a short list of fixes.

Unlike server-side 5xx errors, 431 is a client-side response. The server received your request just fine. It read the headers, decided they were too large to process, and refused. Here’s how to get past it.

What Is HTTP Error 431?

HTTP 431 — formally ‘Request Header Fields Too Large’ — is the server’s way of saying it won’t process a request because the HTTP headers attached to it exceed its configured size limit.

Every HTTP request carries headers: metadata like cookies, the referrer URL, content type, authorization tokens, and any custom fields the browser or application adds. There’s no universal maximum defined in the HTTP specification, but individual servers set their own limits for security and performance reasons.

When the total header payload — or a single oversized field — crosses that threshold, the server returns 431 instead of the requested content. The browser usually shows something unhelpful like ‘This page isn’t working’ with no further context.

FieldDetails
Error codeHTTP 431
Error typeClient-side
VariationsRequest Header Fields Too Large / This page isn’t working
Primary causesToo many cookies, long referrer URL, oversized custom request headers

The error is a client-side issue in the sense that the fix often requires changes on the requester’s side — clearing cookies, trimming URLs — but site owners may also need to adjust server configuration to raise the limit.

Fix 1: Clear Your Browser Cookies

Cookies are the most common culprit. Every cookie stored for a domain gets attached to every request header sent to that domain. If a site has accumulated dozens of cookies over multiple visits — session tokens, analytics identifiers, A/B test flags, ad tracking — the cumulative header size can easily exceed server limits.

Clearing cookies resets the request headers to a minimal, clean state.

Clear all cookies in Chrome

  • Click the three-dot menu and select More tools > Clear browsing data, or press Ctrl+Shift+Del.
  • Set Time range to All time.
  • Check Cookies and other site data.
  • Click Clear data.

This logs you out of all sites. Save any passwords or use a password manager before doing this.

Clear cookies for a specific site only

  • Go to Settings > Privacy and security > Cookies and other site data.
  • Click See all cookies and site data.
  • Search for the domain in the Search cookies field.
  • Click the trash icon or Remove All Shown.

This targets just the problematic domain and leaves other site sessions intact. It’s the better approach when you only get the 431 request header fields too large error on one particular site.

Going forward, browsers accumulate cookies silently. If you use sites with heavy personalization or advertising, cookie buildup is fast. Clearing them periodically prevents the error from recurring.

Fix 2: Shorten the Referrer URL

The HTTP Referer header tells the destination server which page you came from. When you click a link with extensive UTM parameters or tracking strings attached, that entire URL lands in the request header.

A URL like /page?utm_source=newsletter&utm_medium=email&utm_campaign=spring2025&utm_content=button_top&utm_term=discount&fbclid=AbCdEfGh&gclid=XyZ123… can push a single header field past the server’s per-field size limit on its own.

Quick fix for visitors

Strip the query string from the URL in your browser’s address bar — delete everything from the question mark onward — and reload. This removes the referrer parameter data from the request. It’s temporary and only affects that page load.

Fix for site owners

Reduce the number of URL parameters in your tracking links. The fewer parameters in the referrer URL, the smaller the header.

  • Use Google’s Campaign URL Builder to generate minimal tracking URLs with only the parameters your analytics actually requires.
  • Audit which UTM parameters you’re actively using in reports. Remove any that aren’t.
  • On WordPress, plugins like URL Params let you control which query parameters are kept or stripped.

A referrer URL that’s under 200 characters won’t trigger a 431. Most server header field limits start at 4KB or 8KB per field — a long UTM chain can get close.

Fix 3: Increase the Server Header Size Limit

If clearing cookies and trimming URLs doesn’t resolve the error, the server’s header size limit is simply set too low for the application’s requirements. This is common in development environments, Node.js applications, and servers handling API requests with large authentication headers or JWT tokens.

This fix requires server access or a conversation with your hosting provider.

Apache

Add or modify the LimitRequestFieldSize directive in your Apache configuration or .htaccess:

LimitRequestFieldSize 16384

The default is 8190 bytes. Adjust to match your actual header requirements.

Nginx

Set the large_client_header_buffers directive in your nginx.conf:

large_client_header_buffers 4 16k;

Node.js / Express

When starting a Node.js HTTP server, pass the maxHeaderSize option:

const server = http.createServer({ maxHeaderSize: 16384 }, app);

The default in Node.js is 8KB (8192 bytes). Applications using large JWT tokens or OAuth headers often need this raised.

If you don’t have direct server access, contact your hosting provider’s support team with the specific error and your server stack. They can adjust the limit at the server level. The http header size limit setting varies by software, but most support raising it without performance impact.

How to Prevent HTTP 431 Errors

Three things keep 431 errors away long-term:

  • Set appropriate server header limits from the start. When configuring a new application or API, size the header buffer to match real-world token and cookie sizes rather than relying on defaults built for simpler request patterns.
  • Keep cookies lean. Don’t store more data in cookies than you need. Session identifiers should be short tokens, not full user objects. Regularly audit and purge cookies that are no longer required by the application.
  • Minimize URL parameters. Use canonical, minimal tracking URLs. Consolidate UTM parameters into as few fields as your analytics requires. If a parameter isn’t in your reports, it’s adding header weight for no reason.

If you’re seeing this error on a site you don’t control and the basic visitor fixes don’t work, the server’s header limit is too restrictive for typical usage. Report it to the site owner with the specific error code and the browser you’re using.

HTTP 431 Error FAQs

What exactly causes HTTP error 431?

The server received an HTTP request where the total header size, or a single header field, exceeded the server’s configured maximum. The most common triggers are large cookie collections, long referrer URLs with tracking parameters, and oversized authentication headers such as JWTs.

Does error 431 mean my site is down?

Not necessarily. Other visitors may load the site fine if their headers are smaller — fewer cookies, shorter referrer chains. Run a check using an online ‘is it down for everyone’ tool. If the site loads from other connections, the issue is on your end.

How do I fix 431 if I’m not the site owner?

Clear all cookies for the domain, strip query parameters from the URL, and try a different browser or incognito window. If none of those work, contact the site owner — the server’s header limit may need to be raised.

What are the consequences of the 431 error?

The server rejects the request entirely. For visitors, that means the page doesn’t load. For applications, it can mean failed API calls, broken authentication flows, or incomplete form submissions. Nothing is processed on the server side when 431 fires.

Scroll to Top