413

Content Too Large

Overview

413 Content Too Large (formerly Payload Too Large) means the request body exceeds the size the server is willing to process. You hit it with file uploads, large JSON documents, or base64-encoded data.

The limit can live in the application (e.g. an Express body-parser limit) but also in front of it — the reverse proxy (Nginx client_max_body_size), a cloud load balancer, or an API gateway. Identify which layer rejected the request first.

When it happens

Request / Response example

Request
POST /uploads HTTP/1.1
Host: api.example.com
Content-Type: image/png
Content-Length: 47185920

<47 MB body>
Response
HTTP/1.1 413 Content Too Large
Content-Type: application/json

{"error":"file_too_large","maxBytes":10485760}

In code

# Default is 1m; raise it where large uploads are expected
http {
  client_max_body_size 20m;
}
const express = require('express');
const app = express();
// Reject bodies over 10 MB with a 413
app.use(express.json({ limit: '10mb' }));

Common causes

How to fix

Notes

Related status codes

Related headers

Specification