20 MB PDF File — Sample Download, Exact Size
A valid 20 MB sample PDF of exactly 20,971,520 bytes, built in your browser: free, no sign-up, nothing uploaded. Shows which upload limits it meets.
Last updated:
A 20 MB PDF is 20,971,520 bytes: most of the way to Gmail's attachment limit and long enough to send that a slow connection shows its weaknesses. Press the button to build a valid PDF of exactly this size on your device, then use it where a smaller file would be over before it started.
Built on your device in a moment: nothing is uploaded, and no file is hosted. A different size, another file type or a PDF with several pages: test file generator.
The exact file
| Size | 20 MB (1 KB counted as 1,024 bytes) |
|---|---|
| Exact length | 20,971,520 bytes |
| In decimal megabytes | 20.972 MB |
| As base64, as sent inside JSON | 27,962,028 bytes |
| Pages | 1 (the rest is unused data that readers skip) |
| Saved as | test-file-20mb.pdf |
Close to the email limit
Gmail's help page gives 25 MB as the limit for attachments on personal accounts, and this file uses about four fifths of it. That leaves room for a short message and a small second attachment but not for another file this size. It is a good fit for testing how a mail client or a document portal reports a message that is nearly full.
Will a 20 MB PDF pass these upload limits?
| Limit | Written as | This file |
|---|---|---|
| Express body-parser (default)the largest request body its JSON and form parsers accept. Express body-parser documentation | 100kb | Over: rejected unless the limit is raised |
| nginx (default)the largest request body nginx passes on; a bigger one gets a 413 error. nginx core module documentation | client_max_body_size 1m | Over: rejected unless the limit is raised |
| PHP upload_max_filesize (default)the largest single uploaded file. PHP manual, core php.ini directives | 2M | Over: rejected unless the limit is raised |
| PHP post_max_size (default)the largest whole POST request, all fields and files together. PHP manual, core php.ini directives | 8M | Over: rejected unless the limit is raised |
| Gmail attachments (personal accounts)the largest total size of attachments on a message. Gmail Help, send attachments | 25 MB | Fits |
| Cloudflare upload limit (Free and Pro plans)the largest request body Cloudflare passes to your site. Cloudflare support docs, error 413 | 100 MB | Fits |
Each limit is the default or documented figure from the source named beside it. Your own server or plan may differ, and an upload is a request that carries headers as well as the file, which the "right at the limit" verdict allows for.
Timeouts on slow connections
At 5 Mbps the file takes about 34 seconds to send, at 20 Mbps about 8.4 seconds and at 100 Mbps about 1.7 seconds. Some proxies and load balancers close a request that takes longer than a configured time, often counted in tens of seconds, so the slow case is the one to try if your uploads time out for mobile visitors.
How long does a 20 MB upload take?
| Connection | Time to send 20,971,520 bytes |
|---|---|
| 5 Mbps | 34 s |
| 20 Mbps | 8.4 s |
| 100 Mbps | 1.7 s |
Best case: bytes times eight, divided by the speed in megabits per second, ignoring protocol overhead and the connection's ups and downs.
Building it on a phone
The file is assembled in your browser's memory, so a phone needs room for the whole 20 MB while it is made. This is usually fine on a modern phone, but if the page stalls, close other tabs and try again, or build the file on a computer and copy it across.
Frequently asked questions
- How do I download a 20 MB PDF file?
- Press the download button on this page. Your browser builds a valid PDF of exactly 20,971,520 bytes in a moment and saves it as test-file-20mb.pdf. Nothing is uploaded and no file is hosted, so there is no link to copy: the file exists only on your device.
- Will a 20 MB PDF go through Gmail?
- On a personal account, yes: the limit on Gmail's help page is 25 MB for attachments and this file is under it. A work or school account may have a lower limit set by its administrator, and the receiving side has limits of its own.
- Why does my upload time out with a 20 MB file?
- Usually because the request takes longer than a timeout somewhere in the chain, such as a proxy, a load balancer or the server itself, or because the file exceeds a size limit and the connection is closed. This file takes about 34 seconds at 5 Mbps, so try a fast and a slow connection to see which one fails.
- Does this file work for testing a progress bar?
- Yes. At typical home connection speeds it takes several seconds to tens of seconds to send, long enough to see the bar move, pause and finish. For a longer transfer use the 50 MB or 100 MB page.