413 Content Too Large
Request payload exceeds server's size limits.
The request content (body) is larger than the server is willing or able to process.
RFC 9110 renamed 413 to "Content Too Large". Older names you will still see in error messages are "Payload Too Large" (RFC 7231) and "Request Entity Too Large" (RFC 2616).
What HTTP 413 Content Too Large Means
The request content (body) is larger than the server is willing or able to process.
Request payload exceeds server's size limits.
Common Causes
- File upload too large
- POST data exceeds limit
- Request body too big
How to Fix It (For Visitors)
- Upload smaller file
- Reduce data size
- Split into multiple requests
How to Fix It (For Developers/Admins)
- Increase client_max_body_size (Nginx)
- Increase LimitRequestBody (Apache)
- Increase upload_max_filesize (PHP)
- Implement chunked uploads
Upload Limits by Server
| Server / layer | Setting | Default |
|---|---|---|
| nginx | client_max_body_size | 1m |
| Apache | LimitRequestBody | Depends on version |
| PHP | upload_max_filesize / post_max_size | 2M / 8M |
| IIS | requestLimits maxAllowedContentLength (bytes) | 30,000,000 bytes |
| ASP.NET (System.Web) | httpRuntime maxRequestLength (KB) | 4096 KB |
| Cloudflare proxy | Plan upload limit | 100 MB on Free and Pro |
Every layer in the chain must allow the size: raising PHP's limit does nothing if nginx in front of it still rejects the body.
# nginx (http, server or location block)
client_max_body_size 50m;
# php.ini
upload_max_filesize = 50M
post_max_size = 55M
"Maximum request length exceeded" in ASP.NET
The ASP.NET exception HttpException (0x80004005): Maximum request length exceeded means the request body exceeded maxRequestLength. On IIS you usually need to raise two values, and note that they use different units:
<system.web>
<httpRuntime maxRequestLength="51200" /> <!-- KB = 50 MB -->
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" /> <!-- bytes = 50 MB -->
</requestFiltering>
</security>
</system.webServer>When only maxAllowedContentLength is exceeded, IIS answers with sub-status 404.13 instead of 413.
Returning a 413 Content Too Large (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 413 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(413).json({ error: 'Content Too Large' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Content Too Large'), 413
PHP
<?php
http_response_code(413);
header('Content-Type: application/json');
echo json_encode(['error' => 'Content Too Large']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 413 Content Too Large
Frequently Asked Questions
What does HTTP 413 Content Too Large mean?
Request payload exceeds server's size limits. In short: The request content (body) is larger than the server is willing or able to process.
Is 413 Content Too Large a client or server error?
413 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.
How do I fix a 413 Content Too Large error?
Increase client_max_body_size (Nginx). Increase LimitRequestBody (Apache). Increase upload_max_filesize (PHP).
Official Specification
The 413 Content Too Large status code is defined in RFC 9110 Section 15.5.14.