> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markpdf.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Boundaries

> Sizes and limits that should be known.

# Boundaries

| Limit                                                      | Default value | Variable               |
| ---------------------------------------------------------- | ------------: | ---------------------- |
| Raw Upload (`/convert/raw`, `/convert`, `/convert/stream`) |          12MB | `RAW_UPLOAD_MAX_BYTES` |
| Download `from-url`/`accelerated`                          |         500MB | `FETCH_MAX_BYTES`      |
| Processing hard stop                                       |         500MB | `MAX_INPUT_BYTES`      |
| Maximum pages on a PDF                                     |          5000 | `MAX_PDF_PAGES`        |
| Maximum files within a ZIP                                 |            20 | `MAX_ZIP_FILES`        |
| Maximum document size within a ZIP                         |         1.5GB | `MAX_ZIP_MEMBER_BYTES` |

## Two different limits: raw vs storage URL

The **raw upload** (body of `/convert/raw`) has its own and much lower limit (12 MB) than the processing limit (500 MB). The raw travels through the entire network before starting to convert, so a huge body spends seconds just transferring. That's why:

* **PDF small** → `/convert/raw` direct.
* **PDF large** → upload it to your storage and use [`/convert/from-url`](/docs/api/convert-from-url) or `/convert/accelerated`, which **do not** apply the raw limit (still `FETCH_MAX_BYTES`, 500 MB).

Detail and size table in [Raw vs storage URL](/docs/performance/raw-vs-from-url).

## What happens when you overcome them

* Raw upload above `RAW_UPLOAD_MAX_BYTES` → `413` with a useful JSON body (`error`, `max_raw_upload_mb`, `why`, `recommendation`, `recommended_endpoint`) that tells you how to do it right. The bug never leaks the signed URL or internal paths.
* Document or download above `MAX_INPUT_BYTES`/`FETCH_MAX_BYTES` → `413`.
* PDF with more pages than the limit → `413`.
* ZIP with too many entries or too large member → `413`.

The raw limit is measured over **decompressed** bytes: a `gzip`/`zstd` body that decompresses above the limit is also rejected.

<Note>
  You can raise the raw limit with `RAW_UPLOAD_MAX_BYTES`, or disable it completely with `ALLOW_LARGE_RAW_UPLOAD=true` (reverts to `MAX_INPUT_BYTES`). In general it is not worth it: for large files, `from-url` is faster.
</Note>

## Recommendations

* For very large documents, upload to your storage and use [`/convert/from-url`](/docs/api/convert-from-url): avoid resending bytes.
* Compress the upload with gzip or zstd in [`/convert/raw`](/docs/api/convert-raw).
* Split huge documents into logical parts if you only need sections.

<Note>
  The real value to an agent is in responding quickly with useful Markdown, not in accepting the largest file possible.
</Note>
