2 MB sample files

A 2,097,152-byte file: exactly the default upload limit of PHP, and twice the default of nginx and Spring Boot. Available in 15 formats.

Download a 2 MB file

Each file is exactly 2,097,152 bytes and is a valid file of its format. Any of them works as a 2 MB dummy file or test file.

2 MB sample files in every available format
FileFormatSizeContentsDownload
2 MB PDF samplesample-pdf-2mb.pdf PDF 2 MB2,097,152 bytes Pages: 10 Download PDF
2 MB TXT samplesample-txt-2mb.txt TXT 2 MB2,097,152 bytes Numbered lines: 21,096 Download TXT
2 MB CSV samplesample-csv-2mb.csv CSV 2 MB2,097,152 bytes Data rows: 15,657 Download CSV
2 MB JSON samplesample-json-2mb.json JSON 2 MB2,097,152 bytes Records: 6,052 Download JSON
2 MB XML samplesample-xml-2mb.xml XML 2 MB2,097,152 bytes Elements: 6,527 <customer> records Download XML
2 MB PNG samplesample-png-2mb.png PNG 2 MB2,097,152 bytes 957 × 730 px Download PNG
2 MB JPG samplesample-jpg-2mb.jpg JPG 2 MB2,097,152 bytes 2,866 × 2,148 px Download JPG
2 MB ZIP samplesample-zip-2mb.zip ZIP 2 MB2,097,152 bytes Entries: 4 Download ZIP
2 MB BIN samplesample-bin-2mb.bin BIN 2 MB2,097,152 bytes Pseudo-random bytes Download BIN
2 MB DOCX samplesample-docx-2mb.docx DOCX 2 MB2,097,152 bytes Headings, paragraphs, a bulleted list, a table and one image Download DOCX
2 MB XLSX samplesample-xlsx-2mb.xlsx XLSX 2 MB2,097,152 bytes Data rows: 30,684 Download XLSX
2 MB PPTX samplesample-pptx-2mb.pptx PPTX 2 MB2,097,152 bytes Slides: 5 Download PPTX
2 MB MP3 samplesample-mp3-2mb.mp3 MP3 2 MB2,097,152 bytes 2 min 11 s Download MP3
2 MB WAV samplesample-wav-2mb.wav WAV 2 MB2,097,152 bytes 11.9 s Download WAV
2 MB MP4 samplesample-mp4-2mb.mp4 MP4 2 MB2,097,152 bytes 640 × 360 px Download MP4

What is a 2 MB test file?

Two megabytes is the limit that PHP has shipped with for decades: upload_max_filesize defaults to 2M, which is 2,097,152 bytes. This file is exactly that size, so an untuned PHP application accepts it and refuses anything one byte larger.

It is also the first size that fails on stacks tuned for 1 MB. nginx and Spring Boot both reject it by default, which makes it a quick way to find out whether somebody has already raised the limits in an environment you did not set up.

In everyday terms: A high-resolution photo, or about two minutes of MP3 audio at 128 kbit/s.

Limits near 2 MB

Default limits in widely used software that a 2 MB file is useful for testing. Defaults change between versions, so confirm them in the documentation for the version you run.

SystemLimitWhat happens at 2 MB
PHP2 MB per uploaded file by default (upload_max_filesize)A file of exactly 2 MB is accepted; one byte more is refused.
nginx1 MB by default (client_max_body_size)Rejected with 413 Request Entity Too Large.
Spring Boot multipart1 MB per file by default (max-file-size)Rejected unless the property is raised.
Django2.5 MB in memory by default2 MB is held in memory; the 5 MB sample is streamed to a temporary file.
Vercel Functions4.5 MB request bodyAccepted, including as base64 at about 2.8 MB.

Good for

  • Boundary tests at the PHP default upload limit
  • Finding out whether a 1 MB default has been raised
  • Testing "maximum 2 MB" rules on document and photo uploads
  • Upload tests that are quick but large enough to show progress

Transfer time

How long 2,097,152 bytes take to move, before any compression.

1 Mbit/s (slow mobile or uplink)17 seconds
10 Mbit/s (basic broadband)1.7 seconds
100 Mbit/s (fast broadband)under 1 second

Related

Next sizes: 1 MB sample files and 5 MB sample files.

2 MB files: questions

Why does a 2 MB upload work in PHP but not behind nginx?
They enforce different defaults. PHP allows files up to 2 MB, while nginx refuses request bodies over 1 MB before PHP ever sees them. Raise client_max_body_size in nginx to match.
How many bytes is 2 MB?
2 MB is 2,097,152 bytes on this site. Sizes use binary units, in which 1 KB is 1,024 bytes and 1 MB is 1,048,576 bytes.