413 Content Too Large

HTTP Status CodesClient (4xx)commonStatus Code: 413Last updated: todayTested on:Google ChromeNode.js v20 LTSJune 2026

Request entity is larger than limits defined by the server.

413 Content Too Large Quick Fix⏱️ Est. Fix Time: 3 minutes

Usually happens because:

  • Uploading files that exceed server
  • Sending extremely large JSON array

🔍 Quick Checklist:

Meaning

The HTTP 413 Content Too Large client error status code (formerly Payload Too Large) indicates that the request entity is larger than limits defined by the server; the server might close the connection or return a Retry-After header field.

Root Causes

  • Uploading files that exceed server configuration limits (e.g. Nginx client_max_body_size).
  • Sending extremely large JSON array batches to REST endpoints.
CauseFrequency
Uploading files that exceed server⭐⭐⭐⭐⭐
Sending extremely large JSON array⭐⭐⭐⭐

Common Mistakes

  • Setting backend application body limits higher than proxy (Nginx) limits (results in Nginx returning 413 before the app even receives it).
  • Failing to handle 413 gracefully on the client UI, causing file upload animations to freeze.

How to Fix

1Increase server file upload size configurations.
2Chunk large files into smaller segment slices during client-side uploads.
3Check server request limit variables.

Framework-Specific Examples

Setting body parser size limits in Express.

Express Example
const express = require('express');
const app = express();
// Limit JSON payload body size to 1MB
app.use(express.json({ limit: '1mb' }));

Server Configuration Examples

Increasing client max body size limit in Nginx.

Nginx Config
server {
    client_max_body_size 50M;
}

Prevention

  • Synchronize body size limits across reverse proxies, app gateways, and frameworks.
  • Check file sizes on the client side using JavaScript before starting uploads.

Frequently Asked Questions (FAQ)

Q: What is the new name of 413 Payload Too Large?

In newer HTTP specifications, the name has been updated to '413 Content Too Large' to reflect that it applies to the body content size regardless of payload framing.

Q: How do I fix a 413 error in Nginx?

Add or increase the 'client_max_body_size' directive inside your nginx.conf server or location blocks (e.g. `client_max_body_size 10M;`).

Q: Can I return a Retry-After header with 413?

Yes, servers can include a 'Retry-After' header indicating when the client should try the transaction again.

Q: Should I use chunked uploads to prevent 413?

Yes. Splitting large files into 1MB-5MB chunks and uploading them sequentially is the best way to bypass server size constraints.

Still having this problem?

Didn't solve your problem?

SuggestRequest Error