What 413 Content Too Large means
413 Content Too Large (formerly Payload Too Large) tells the client the request body is bigger than the server is willing to accept. Common limits: 1MB for JSON APIs, 10-100MB for file uploads, multi-GB for object storage. The response should include a Retry-After header (rare but spec-allowed) and ideally a body explaining the limit. Note: the older spec name "Payload Too Large" is still used in many libraries and tools.
When servers should return it: Return 413 when the request body exceeds the configured maximum.
Common causes
- File upload exceeds server limit
- Bulk import payload too large
- JSON body has too many items in an array
- CDN or proxy limit hit before reaching origin
- Nginx client_max_body_size or equivalent exceeded
How to fix 413 Content Too Large
- Split the upload into smaller chunks
- Use multipart/form-data for large files instead of JSON-encoded base64
- Increase server-side limit (Nginx: client_max_body_size, Express: limit option)
- For very large uploads, use signed URLs to upload directly to S3/R2/GCS
Example response
curl -i -X POST -d @huge.json https://api.example.com/import
HTTP/2 413
content-type: application/json
{"error":"payload too large","limit_mb":1,"received_mb":15}
More references
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.