Runs in your browser. Your files and text never leave your device - nothing is uploaded.
4xx Client Error
What it means
The request body is larger than the server is willing or able to process.
| Property | Detail |
|---|---|
| Status class | 4xx Client Error |
| Defined in | RFC 9110, Section 15.5.14 — Named 413 Content Too Large in RFC 9110 (2022), Payload Too Large in RFC 7231, and Request Entity Too Large in RFC 2616, which is the wording nginx still shows. |
| Cacheable by default | Only with explicit caching headers: a cache stores it when the response carries Cache-Control (max-age, s-maxage or public) or Expires. |
| Who needs to act | Whoever controls the size limit, usually the site or API owner. |
What does HTTP 413 Payload Too Large mean?
HTTP 413 means the request body is larger than the server is willing or able to process, so it was rejected, usually during a file upload. RFC 9110 now calls it Content Too Large; older names are Payload Too Large and Request Entity Too Large. The fix is a smaller body or a higher server limit.
How 413 Payload Too Large works
Every layer that reads a request body can enforce its own limit, and the smallest one wins. nginx's client_max_body_size defaults to 1 MB, Express's body-parser accepts 100 KB of JSON by default, and CDNs, load balancers and serverless platforms add their own caps. RFC 9110 lets the server stop reading and close the connection once the limit is exceeded, and if the condition is only temporary it should send Retry-After. Clients that send Expect: 100-continue can find out before uploading, because the server can return 413 from the Content-Length header alone.
Example 413 request and response
POST /api/media HTTP/1.1
Host: example.com
Content-Type: image/png
Content-Length: 15728640
HTTP/1.1 413 Content Too Large
Connection: close
Content-Type: text/htmlA 15 MB upload against a smaller limit. The server rejects it on the Content-Length header and closes the connection rather than reading the rest.
What causes a 413 Payload Too Large
- Uploading a file larger than the server, proxy or CDN allows.
- nginx's default client_max_body_size of 1 MB, a frequent surprise when a site moves behind nginx.
- JSON bodies over a framework limit, such as the 100 KB default of Express's body-parser.
- Base64-encoding a file inside JSON, which makes it about a third larger.
How to fix a 413 Payload Too Large
If you are uploading
- Compress or resize the file, or split it into smaller parts.
- Check the service's documented maximum size.
- For APIs, send files as multipart or raw binary rather than base64 inside JSON.
If you run the server
- Raise the limit at every layer: nginx client_max_body_size, the application framework's body limit, and any CDN or load balancer cap.
- Return a clear message that states the maximum size.
- For very large files, use chunked or resumable uploads, or let clients upload straight to object storage with presigned URLs.
Related status codes
- 414 URI Too Long: The URL is too long, rather than the body.
- 431 Request Header Fields Too Large: The headers are too large, often because of cookies.
- 507 Insufficient Storage: The server has run out of storage space, rather than rejecting the size of one request.
Tools that help
- Image Compressor shrinks JPG, PNG and WebP files under an upload limit.
- Compress PDF reduces PDF size before uploading.
Frequently asked questions
The request body is larger than the server is willing or able to process.
Uploading a file or sending a request body that exceeds the server's configured size limit.
Reduce the file or payload size, or check with the API provider for their maximum allowed size. Site owners: raise the body size limit at every layer.
Increase client_max_body_size in the http, server or location block, for example client_max_body_size 50M;, then reload nginx. The default is 1 MB. Raise the matching limit in your application or framework too, or the request will fail one layer later.
Sources
Other 4xx Client Error codes
Reviewed by Raja Jahangir · Last reviewed: October 7, 2026
