Dummy 5 MB PDF File
Generate and download a dummy 5 MB PDF file. The download is exactly 5,242,880 bytes, created in your browser and never uploaded.
Need a different size? Make a dummy PDF file of any size from 4 KB to 100 MB.
Testing with a 5 MB PDF file
A 5 MB PDF is under the 6 MB AWS Lambda synchronous payload limit, but base64 encoding adds about a third, so the encoded body is around 7 MB and can be rejected. That is a common surprise with API Gateway plus Lambda uploads.
It is also above PHP’s default 2 MB upload_max_filesize, so it is a quick way to confirm a server’s PHP limits were raised.
With the default settings the pages are the same 10 as in the 1 MB file, so an upload that works at 1 MB and fails at 5 MB points at a size limit, a timeout or memory use and not at the document. Bisect between the two sizes with the unit set to B to find the actual cut-off.
- Exact size (binary)
- 5,242,880 bytes
- Decimal equivalent
- 5,000,000 bytes
- Base64-encoded size
- 6,990,508 bytes
- Pages
- 10 (default; choose 1 to 200 in Options)
Exact size and boundary files for 5 MB
Set the unit to B and enter these byte counts to test either reading of 5 MB.
| Limit defined as | One under (should pass) | At the limit | One over (should fail) |
|---|---|---|---|
| Binary 5 MB | One under (should pass) 5,242,879 B | At the limit 5,242,880 B | One over (should fail) 5,242,881 B |
| Decimal 5 MB | One under (should pass) 4,999,999 B | At the limit 5,000,000 B | One over (should fail) 5,000,001 B |
Limits closest to 5 MB
A 5 MB file is over nginx (1 MB) and PHP (2 MB); under AWS Lambda (6 MB), API Gateway (10 MB), Outlook with Exchange (10 MB), Outlook with internet accounts (20 MB), Gmail (25 MB) and Cloudflare Free and Pro (100 MB). Sent as base64 text it grows past AWS Lambda.
| Limit | Size | Notes |
|---|---|---|
| nginx client_max_body_size (default) | 1 MB 1,048,576 B | Requests with a larger body get HTTP 413. |
| PHP upload_max_filesize (default) | 2 MB 2,097,152 B | Also capped by post_max_size, so raise both. |
| AWS Lambda synchronous invocation payload | 6 MB 6,291,456 B | Applies to request and response. |
Other dummy PDF file sizes
Smaller: 1 MB PDF. Larger: 10 MB PDF. Or see the full dummy PDF file generator.
Other 5 MB dummy files
The same size in another file type.
5 MB PDF file FAQ
Is the 5 MB PDF file exactly 5 MB?
Yes: 5,242,880 bytes in binary units. For a decimal 5 MB, set the unit to B and enter 5,000,000.
How many pages does a 5 MB dummy PDF have?
10 pages of A4 text by default. The page count is an option and does not depend on the file size: choose 1 to 200 pages in Options and the file stays exactly 5,242,880 bytes. If the pages need more than 5 MB, the tool says the minimum size they need.
Is a 5 MB dummy PDF mostly filler?
With the default 10 pages, yes. The document is about 23 KB, so most of the 5,242,880 bytes is a PDF comment after the final %%EOF marker, outside the document structure. More pages mean less filler.
Will a 5 MB PDF file pass the AWS Lambda synchronous invocation payload?
Yes, as a raw binary upload: it is 1,048,576 bytes under the 6 MB limit (6,291,456 bytes), which leaves room for the few hundred bytes of multipart headers. As base64 it is 6,990,508 characters, over the limit, and that is the size that counts in a JSON body or an email.
Is the file uploaded anywhere?
No. It is generated in your browser and never leaves your device.