413 Content Too Large (formerly Payload Too Large)
This is an educational reference page about HTTP 413 Content Too Large. The page itself is served as 200 OK so it can be indexed as HTTP documentation.
The request content is larger than the server is willing or able to process. RFC 7231 called this 413 Payload Too Large, and RFC 2616 called it 413 Request Entity Too Large.
Specification
Registered in the IANA HTTP Status Code Registry as Content Too Large. Defined in RFC 9110, Section 15.5.14.
What it means
HTTP 413 Content Too Large means the request body is bigger than the server will accept. RFC 9110 renamed the code; older docs and servers still say 413 Payload Too Large or 413 Request Entity Too Large, and all three names mean the same thing. The server may close the connection instead of reading the rest of the body.
When to use it
- Return 413 when an upload or JSON body exceeds a configured size limit.
- Send Retry-After when the limit is temporary, such as a quota that resets. RFC 9110 says the server SHOULD include it in that case.
- Use 431 Request Header Fields Too Large when the headers, not the body, are too big. Use 414 URI Too Long for long URLs.
Common causes
- A file upload larger than the application or proxy allows.
- A reverse proxy limit. nginx's client_max_body_size defaults to 1 MB and returns 413 above it.
- A large JSON or base64 payload sent to an endpoint that expects small requests.
- A CDN, load balancer, or API gateway with its own body limit in front of the application.
Where you see it
- File upload forms, image and video APIs, import tools, and bulk JSON endpoints.
- Reverse proxies such as nginx, CDNs, API gateways, and load balancers, before the request reaches the application.
- Frameworks with default body-parser limits.
Headers involved
- Content-Length lets the server reject an oversized request before reading the body.
- Expect: 100-continue lets a client ask before sending a large body. The server can answer 413 without receiving the upload.
- Retry-After tells the client when to try again if the limit is temporary.
Client fixes
- Reduce the file size, split the data into smaller requests, or use the API's resumable or chunked upload flow.
- Check the documented size limit before sending.
- Do not retry the same body unchanged unless the response includes Retry-After.
Server fixes
- Set the same limit at every layer: CDN, load balancer, reverse proxy, framework, and application. The smallest limit wins.
- Return the maximum accepted size in the error body so clients can adjust.
- Send large files directly to object storage with signed upload URLs instead of through the application server.
Examples
Upload over the limit
POST /api/uploads HTTP/1.1
Host: api.example.com
Content-Type: image/png
Content-Length: 26214400
(25 MB of image data)
HTTP/1.1 413 Content Too Large
Connection: close
Content-Type: application/problem+json
{
"type": "https://api.example.com/problems/upload-too-large",
"title": "Upload exceeds 10 MB",
"status": 413,
"maxBytes": 10485760
}
Rejected before the body is sent
PUT /api/backups/latest HTTP/1.1
Host: api.example.com
Content-Length: 5368709120
Expect: 100-continue
HTTP/1.1 413 Content Too Large
Connection: close
Content-Type: application/json
{
"error": "Backups larger than 2 GB must use multipart upload."
}
Common mistakes
- Raising the application limit without raising the proxy limit, or the other way around. The smaller limit still returns 413.
- Returning 400 or 500 for an oversized body. Clients cannot tell that size is the problem.
- Using 413 for too many items in a well-formed JSON array that is within the byte limit. That is a validation rule, usually 422.
Developer notes
A browser may show a 413 from a proxy as a connection reset instead of an error page, because the proxy closes the connection while the browser is still sending. If users report failed uploads with no error message, check the proxy logs for 413.
Questions
What does HTTP 413 mean?
HTTP 413 Content Too Large means the request body is larger than the server will accept.
Is 413 Payload Too Large the same as 413 Content Too Large?
Yes. RFC 9110 renamed 413 Payload Too Large to Content Too Large. Older names include Request Entity Too Large. The meaning did not change.
How do I fix 413 in nginx?
Raise client_max_body_size in the http, server, or location block that handles the upload, then reload nginx. The default is 1 MB.
See also
- 411 Length Required
- 414 URI Too Long
- 431 Request Header Fields Too Large
- REST API status code chooser
Header and content rules
What RFC 9110 says about a 413 response, quoted from the RFC. The 4xx class rules also apply.
- SHOULD (server; Retry-After): Send Retry-After to say the limit is temporary and when the client can try again. When: The condition is temporary. Table row
If the condition is temporary, the server SHOULD generate a Retry-After header field to indicate that it is temporary and after what time the client MAY try again. RFC 9110 §15.5.14
The same rule is in the response obligations table and its JSON.