Skip to main content
HTTP/4xx (Client Error)

413 Payload Too Large

The request entity is larger than limits defined by server configuration.

❓ Why does this happen?

Uploading a file larger than client_max_body_size (Nginx) or serverless body limits (e.g. 4.5MB on Vercel).

✅ How to fix it

Compress payload or use direct presigned S3/storage uploads instead of proxying through the app server.

Return or handle 413 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Payload Too Large", status: 413 },
    {
      status: 413
    }
  );
}

Live 413 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 413 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/413

Frequently Asked Questions

What does HTTP Status 413 mean?
The request entity is larger than limits defined by server configuration.
Why am I getting a 413 status code?
Uploading a file larger than client_max_body_size (Nginx) or serverless body limits (e.g. 4.5MB on Vercel).
How do I fix a 413 Payload Too Large error?
Compress payload or use direct presigned S3/storage uploads instead of proxying through the app server.
How can I test how my app handles a 413 response?
Send a request to https://castov.com/api/mock/413 — it returns a real 413 Payload Too Large response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.