431

HTTP 431 Request Header Fields Too Large

4xx Client Error

4xx Client Error RFC 6585, Section 5

What is HTTP 431 Request Header Fields Too Large?

The 431 (Request Header Fields Too Large) status code indicates that the server is unwilling to process the request because its header fields are too large. This can occur when a cookie is too large or when the cumulative size of all headers exceeds server limits.

Common Use Cases

  • Oversized cookies
  • Large authentication tokens
  • Excessive number of request headers

Usage Example

When a user has accumulated too many cookies (e.g., tracking cookies from multiple services), requests may exceed the server's header size limit and receive a 431 response. Clear unnecessary cookies or use local storage instead of cookies for non-essential data.

# Nginx - increase header buffer size
large_client_header_buffers 4 32k;

# Apache - increase header limit
LimitRequestFieldSize 16380

Common Mistakes

⚠️

Mistake: Confusing 431 (headers too large) with 413 (body too large)

Fix: Use 431 when the request headers exceed server limits. Use 413 when the request body exceeds size limits. They address different parts of the request.

Last updated: 21 Jun 2026