HTTP 413 Payload Too Large — What It Means and How to Fix It

The HTTP 413 Payload Too Large status code indicates that the server is refusing to process a request because the request payload (body) is larger than the server is willing or able to process. This typically occurs when a client sends a file or data that exceeds the server's configured size limits.

Last updated: 2026-06-11

RECOMMENDED

Essential Reading: Designing Data-Intensive Applications

The system design bible for software engineers. Learn to build reliable, scalable, and maintainable systems.

View on Amazon →
Status Code 413
Name Payload Too Large

Common Causes

  • Uploading a file (e.g., image, video, document) that exceeds the web server's maximum allowed upload size.
  • Sending a large amount of data in a POST or PUT request body that surpasses the server's configured request body size limit.
  • Misconfigured proxy servers or load balancers that have their own, lower, payload size limits than the origin server.

Code Examples to Handle HTTP 413

curl -I https://httpbin.org/status/413

How to Fix It

  1. **Client-side:** Reduce the size of the data being sent. This might involve compressing files, splitting large uploads into smaller chunks, or optimizing data structures.
  2. **Server-side (Web Server):** Adjust the maximum request body size limit in the web server configuration (e.g., `client_max_body_size` in Nginx, `LimitRequestBody` in Apache, `maxRequestLength` in IIS/ASP.NET).
  3. **Server-side (Application/Framework):** Check if the application framework or language has its own payload size limits that need to be increased (e.g., Node.js body-parser limits, PHP `upload_max_filesize` and `post_max_size`).
💡 Example: A user tries to upload a 50MB video file to a website, but the web server (Nginx) is configured with a `client_max_body_size` of 10MB. The server immediately responds with a 413 Payload Too Large error, preventing the upload from completing.
🛠️ Developer Tip: When designing APIs or file upload features, always consider potential payload size limits and provide clear client-side feedback or validation before a large request is even sent to the server.

Related Status Codes

Frequently Asked Questions

What causes HTTP 413?

HTTP 413 is caused when the data (payload) sent by the client in a request, such as an uploaded file or a large JSON body, exceeds the maximum size that the server or any intermediary (like a proxy) is configured to accept.

How do I fix HTTP 413?

To fix HTTP 413, you either need to reduce the size of the data being sent from the client, or, more commonly, increase the maximum allowed payload size on the server-side. This involves adjusting configuration settings in your web server (e.g., Nginx, Apache, IIS) or application framework.