HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

413 Content Too Large

Fault: Client
TL;DR

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

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

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.

View the IANA HTTP Status Code Registry →