pdftoolskit.org
PDF (Portable Document Format) utilities, in the browser
Say hi →

Large Sample PDFs — Exact File Sizes for Testing

100 KB · 500 KB · 1 MB · 5 MB · 10 MB · never over the label

Five PDFs padded to land exactly at — or a fraction of a percent under — their advertised size. Built for testing upload limits, size validation, progress bars, and "max file size" error paths, where a file that's accidentally 2% over the boundary ruins the test. Every file opens as a normal 2-page PDF.

The "at or under, never over" guarantee

When you're testing a 5 MB upload limit you need two files: one that should pass and one that should fail. These files are the pass side — each is generated iteratively until it lands inside a 2% window under its target, and the build fails if a file ever exceeds it. For the fail side, use the next size up (the 10 MB file against a 5 MB limit). The 100 KB, 500 KB and 1 MB files hit their byte targets exactly: 102,400 / 512,000 / 1,048,576 bytes.

How the size is achieved (and why it won't compress)

Each file is a normal 2-page text document plus an embedded attachment of seeded-random bytes — random data is incompressible, so the file size is stable even if a proxy or CDN applies gzip on the wire. That also makes these files useful for compression testing in the opposite direction: a compressor that claims big wins on sample-pdf-10mb.pdf is lying to you, because there is almost nothing compressible inside. Honest tools will report ~0% on it.

Because the bytes come from a seeded PRNG, regenerating with the open-source script yields byte-identical files — safe to checksum in CI.

What to test with them

FAQ

Why are the 5 MB and 10 MB files slightly under, not exact?

PDF container overhead (xref table, object headers) varies by a few hundred bytes with content, and the padding is adjusted iteratively. For the three smaller sizes the loop converges on the exact byte count; for 5/10 MB it guarantees "within 2% under" — which is the side you want for a should-pass upload test. If you need byte-exact large files, the generator's tolerance is one constant.

Do the files open like normal PDFs?

Yes — 2 pages of real text in any viewer. The padding lives in an embedded attachment named padding.bin, visible in the inspector and clearly described inside the file.

I need 25 MB / 50 MB / 100 MB.

One line each in the generator script — we keep the hosted set at 10 MB and under so this page stays fast to load. Clone, add sizedDoc(25 * 1024 * 1024, ...), run.

Can I make a big PDF smaller instead?

That's the compress tool — though as noted above, don't expect miracles on these files; they're designed to resist it.