413 Content Too Large

The request body is bigger than the server allows.

Code
413
Reason phrase
Content Too Large
Class
4xx Client error
Defined in
RFC 9110 section 15.5.14
Cacheable by default
No

What it means

Client error: the problem lies with the request. Repeating it unchanged will normally fail again.

When a server should send it. When the request body is larger than the server will accept. If the limit is temporary, add Retry-After. Proxies send it too: nginx's client_max_body_size defaults to 1 MB.

Common causes. Uploading a file above the limit, often nginx client_max_body_size or PHP upload_max_filesize.

What to do. Upload a smaller file, or raise the limit on the server.

How clients and crawlers treat it

Browsers and HTTP clients. Browsers show the error page the server or proxy returns. An upload stopped by a proxy often looks like a broken connection in JavaScript, because the server closes it before reading the body.

Google Search. Like every 4xx except 429, it tells Google the content does not exist: an indexed URL is removed from the index, and a new one is not processed. Crawl frequency for the URL gradually drops. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.

Caching. Not cacheable by default (RFC 9110 section 15.1 does not list it). A cache stores it only when the response says so with Cache-Control or Expires.

Example response

HTTP/1.1 413 Content Too Large
Content-Type: text/plain; charset=utf-8

Content Too Large

How to send 413

nginx
location /example {
    return 413;
}
Apache (.htaccess)
RewriteEngine On
RewriteRule ^example$ - [R=413,L]
PHP
http_response_code(413);
echo 'Content Too Large';
exit;
Node.js
res.writeHead(413, { 'Content-Type': 'text/plain' });
res.end('Content Too Large');
Python (Flask)
# in a view function
return 'Content Too Large', 413

Change the paths to suit. In nginx, add_header needs always to apply to error responses.

Related codes

All status codes · All 4xx codes

Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.