Toolman

HTTP 413 — Payload Too Large

4xx Client Error

What it means

The request body exceeds a limit the server imposes.

What to do about it

Raise the limit (client_max_body_size in nginx, upload_max_filesize in PHP), or have the client upload directly to object storage with a pre-signed URL.

Where it sits

413 belongs to the 4xx family: The request contains something the server will not or cannot process. The fix is normally on the client side.

HTTP/1.1 413 Payload Too Large

Checking it yourself

# see the status code and headers only
curl -sI https://example.com/path

# follow redirects and print each hop
curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/path

# JavaScript
const r = await fetch(url);
console.log(r.status, r.statusText);

How this code behaves

Cacheable by defaultNo — caches must not store this response unless explicit cache headers permit it.
Safe to retryNo. Retrying an identical request will produce the same result — the request itself must change.
Effect on search indexingNo direct effect.

Returning 413 correctly

# nginx
return 413;

# Express
res.status(413).json({ error: 'Payload Too Large' });

# Go
w.WriteHeader(413)

# Python (Flask)
return jsonify(error='Payload Too Large'), 413;

Frequently asked questions

What does HTTP 413 mean?

The request body exceeds a limit the server imposes.

How do I fix a 413 error?

Raise the limit (client_max_body_size in nginx, upload_max_filesize in PHP), or have the client upload directly to object storage with a pre-signed URL.

Is 413 a client or server problem?

A client problem by definition — the request needs to change. That said, a 4xx can still be the server’s fault if it is misconfigured and rejecting valid requests.

Other 4xx codes

All HTTP status codes