What 431 Request Header Fields Too Large means

431 Request Header Fields Too Large rejects requests with overly large headers. Common causes: cookie sprawl (sites accumulating dozens of large cookies), JWT tokens exceeding header buffer limits, or accidentally setting a very long User-Agent. Server limits vary: Nginx defaults to 8KB, Express 8KB, Cloudflare 32KB. This is rare but visible when it happens.

When servers should return it: Return 431 when total header size or any single header exceeds the configured maximum.

Common causes

  • Very large JWT token in Authorization header
  • Cookie sprawl: many sites accumulate dozens of cookies
  • Forwarded headers in long proxy chains
  • Custom headers stuffed with too much data

How to fix 431 Request Header Fields Too Large

  • Clear cookies for the offending site
  • Move data from headers to request body
  • Use shorter JWT claims or move large data to a separate fetch
  • Increase server header buffer (Nginx: large_client_header_buffers)

Example response

HTTP/2 431
content-type: text/plain
Header section too large

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.