devkult_
tools29converters34

413 Content Too Large

4xx client errorformerly “Payload Too Large”formerly “Request Entity Too Large”

The request body is bigger than the server is willing to accept.

413 means the body — usually an upload — exceeds a size limit. That limit is often not in your application at all but in front of it: nginx defaults to 1 MB (client_max_body_size), and hosting platforms cap request bodies too.

RFC 9110 renamed this status from 'Payload Too Large' (and earlier 'Request Entity Too Large') to 'Content Too Large'.

Class4xx Client Error
Retry?No — change the request first
Cacheable by defaultNo — only with explicit Cache-Control
Response bodyAllowed
Defined inRFC 9110 §15.5.14 — 413 Content Too Large
Example response
HTTP/1.1 413 Content Too Large
Content-Type: application/json
Content-Length: 29

{"error":"Content Too Large"}

Common causes

  • An upload larger than nginx's client_max_body_size (default 1m).
  • Platform limits: Vercel Functions accept 4.5 MB bodies, AWS API Gateway 10 MB.
  • Body-parser limits in the app — Express's express.json() defaults to 100kb.
  • Base64-encoding files inflates them by about a third, pushing them over the limit.

How to fix it

  1. Raise the limit at every layer: nginx (client_max_body_size 20m;), then the app's body parser.
  2. Upload large files straight to object storage with a presigned URL instead of through your server.
  3. Send files as multipart/form-data, not base64 inside JSON.

Useful here: 413 in nginx: raising the upload limit

Send a 413 from your server

Express
res.status(413).json({ error: "Content Too Large" });
Next.js route handler
return Response.json({ error: "Content Too Large" }, { status: 413 });
Flask
return {"error": "Content Too Large"}, 413
Go net/http
http.Error(w, "Content Too Large", http.StatusRequestEntityTooLarge)
nginx
return 413;

Check what a URL returns

Print just the status line from the command line, or check a whole list of URLs at once, with their response headers, in the HTTP Status Checker.

curl -sI https://example.com/your-path | head -n 1

Frequently asked questions

I raised my app's limit — why do I still get 413?

Something in front of the app has its own limit: nginx, a load balancer, an API gateway or the hosting platform. Check each hop; the smallest limit wins.

What is nginx's default upload limit?

1 MB (client_max_body_size 1m). Set it in the http, server or location block and reload nginx.

Headers used with 413
Related status codes