HTTP 414 vs 413 — URI Too Long vs Payload Too Large Comparison
http 414 vs 413: 414 fires when the URL itself is too long, 413 when the request body is too big. Learn typical limits in Nginx, ALB, and Cloudflare.
Quick Cheat Sheet
| Aspect | 414 URI Too Long | 413 Content Too Large |
|---|---|---|
| What's too big? | The request line / URL | The request body |
| Triggered by | Long path, huge query string | Big upload, oversized JSON |
| Typical limit | 4–8 KB in URL | 1 MB – 5 GB depending on stack |
| Headers to look at | large_client_header_buffers (Nginx) |
client_max_body_size (Nginx) |
What Each Code Means
414 URI Too Long (RFC 9110 § 15.5.15) is returned when the URL — not the body — exceeds what the server is willing to parse. The most common cause is a runaway query string, often from accidentally serializing a large JSON object into a GET parameter.
413 Content Too Large (renamed from "Payload Too Large" in RFC 9110 § 15.5.14) is for oversized request bodies: file uploads, base64-encoded images, large JSON payloads.
Typical Limits in the Wild
For URL length (414 territory):
- Nginx: ~8 KB by default (
large_client_header_buffers 4 8k) - Apache: 8190 bytes by default (
LimitRequestLine) - AWS ALB: 16 KB total request line + headers
- Cloudflare: 8 KB URL maximum
- Most browsers: 2 KB practical limit (IE), ~32 KB (Chrome/Firefox)
For body size (413 territory):
- Nginx: 1 MB default (
client_max_body_size) - Express/body-parser: 100 KB default
- AWS API Gateway REST: 10 MB hard cap
- Cloudflare Free: 100 MB
- AWS S3 single PUT: 5 GB (use multipart above)
When 414 Hits Production
The classic cause of 414 in real apps is a GET request with hundreds of query parameters — for example, a search UI that builds a filter list as ?ids[0]=1&ids[1]=2... and accidentally generates 5,000 IDs. The fix is almost always to switch to POST with a JSON body.
When 413 Hits Production
- Forgetting to raise
client_max_body_sizein Nginx for an upload endpoint - Sending base64-encoded image data in JSON (33% larger than binary)
- Hitting AWS API Gateway's 10 MB cap (use S3 pre-signed PUT instead)
- WordPress' notorious
upload_max_filesizePHP limit
Best Practice
- For uploads, design the API to accept multipart/form-data or use a pre-signed direct-to-S3 URL, both of which bypass typical body limits.
- For long lists of IDs, prefer POST with JSON body over giant GET query strings.
- Always document body limits in your API reference.
A Pitfall
Many proxies silently truncate URLs or bodies before returning these codes, leading to mysterious 400s instead of clear 414/413. Check proxy logs.
Real-World Use Case
A search endpoint that started returning 414 in production was building filter URLs like /products?categories=a,b,c,...,zzz with a 12 KB query string. Fix: convert the endpoint to POST /products/search with a JSON body. For an image upload returning 413 in Nginx-fronted apps, raise client_max_body_size from the 1 MB default and configure matching limits in your app server.
Look Up Any Status Code
Related Comparisons
HTTP 415 vs 406 — Unsupported Media Type vs Not Acceptable Comparison
http 415 vs 406: 415 is about Content-Type the client sent, 406 is about Accept the client wants. Learn the request vs response negotiation difference.
HTTP 400 vs 422 — Bad Request vs Unprocessable Entity Comparison
http 400 vs 422 explained: when to return Bad Request for malformed syntax versus Unprocessable Entity for valid syntax that fails business validation. Includes API examples.
HTTP 405 vs 501 — Method Not Allowed vs Not Implemented Comparison
http 405 vs 501: 405 means this method isn't allowed on this resource, 501 means the server doesn't implement the method at all. With Allow header guidance.
HTTP 429 vs 503 — Too Many Requests vs Service Unavailable Comparison
http 429 vs 503: when to return Too Many Requests for per-client rate limits versus Service Unavailable for overall capacity issues. Includes Retry-After header guidance.