What HTTP 413 means
Formerly called “Payload Too Large” and “Request Entity Too Large”. The upload or JSON body exceeds a size limit set by the server, a proxy in front of it, or the framework.
How to fix a 413 error
-
nginx defaults to
client_max_body_size 1m. Raise it in thehttp,serverorlocationblock. -
Express’s
express.json()accepts 100 kB by default; pass{ limit: "10mb" }. - Behind a load balancer or CDN, check its limit too: Cloudflare’s free plan caps uploads at 100 MB.
- For big files, upload directly to object storage with presigned URLs instead of through your API.
Retrying
No. Fix the request first; sending it again unchanged will get the same response.
Example response
HTTP/1.1 413 Content Too Large
Date: Wed, 21 Oct 2026 10:30:00 GMT
Connection: close
Content-Type: application/json
How to return 413
res.status(413).json({ error: 'Content Too Large' });
from fastapi import HTTPException
raise HTTPException(status_code=413, detail="Content Too Large")
http.Error(w, http.StatusText(http.StatusRequestEntityTooLarge), http.StatusRequestEntityTooLarge)
location /private/ {
return 413;
}
Related status codes
- 414 URI Too Long : The request URL is longer than the server will accept.
- 431 Request Header Fields Too Large : The request headers, often cookies, are too large for the server.
- 411 Length Required : The server requires a Content-Length header.
Other 4xx status codes
400 Bad Request · 401 Unauthorized · 402 Payment Required · 403 Forbidden · 404 Not Found · 405 Method Not Allowed · 406 Not Acceptable · 407 Proxy Authentication Required · 408 Request Timeout · 409 Conflict · 410 Gone · 411 Length Required · 412 Precondition Failed · 414 URI Too Long · 415 Unsupported Media Type · 416 Range Not Satisfiable · 417 Expectation Failed · 418 I’m a Teapot · 421 Misdirected Request · 422 Unprocessable Content · 423 Locked · 424 Failed Dependency · 425 Too Early · 426 Upgrade Required · 428 Precondition Required · 429 Too Many Requests · 431 Request Header Fields Too Large · 444 No Response · 451 Unavailable For Legal Reasons · 499 Client Closed Request
See the full list of HTTP status codes.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does HTTP 413 Content Too Large mean?
HTTP 413 Content Too Large means the request body is larger than the server allows. Formerly called “Payload Too Large” and “Request Entity Too Large”. The upload or JSON body exceeds a size limit set by the server, a proxy in front of it, or the framework.
How do I fix HTTP 413?
nginx defaults to client_max_body_size 1m. Raise it in the http, server or location block. Express’s express.json() accepts 100 kB by default; pass { limit: "10mb" }. Behind a load balancer or CDN, check its limit too: Cloudflare’s free plan caps uploads at 100 MB. For big files, upload directly to object storage with presigned URLs instead of through your API.