413 Content Too Large
Request payload exceeds server's size limits.
The request entity is larger than limits defined by the server.
What HTTP 413 Content Too Large Means
The request entity is larger than limits defined by the server.
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
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 entity is larger than limits defined by the server.
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 7231 Section 6.5.11.