Stax

…

Tools

Test File Generator — Exact Size, Free, No Upload

Create a dummy PDF, JPG, PNG, CSV, JSON, ZIP or text file of an exact size such as 200 KB or 5 MB, in your browser. Free, no upload, no sign-up.

Last updated:

1,048,576 bytes exactly. Smallest PDF: 803 bytes. Largest: 200 MiB.

Was this tool useful?

Use the tool above and you can rate it here.

Make a dummy file of exactly the size you need

When you build or test an upload form you need files of known sizes: one just under the limit, one exactly on it, one a byte over. This tool builds them on your device. Pick a type (PDF, JPG, PNG, CSV, JSON, XML, ZIP, plain text and more), type a size such as 200 KB or 5 MB, and download a real file of exactly that many bytes. Nothing is uploaded, and there is nothing to install.

Why exact size matters

A form that accepts up to 2 MB must be tested at 2 MB and just over it. In bytes that is a file of 2,097,152 and one of 2,097,153, and a file that is one byte too big is the test that finds off-by-one mistakes. Download sites with a size in the file name give you round numbers only, and they have to host and serve every file. Here the file is built in your browser to the byte, so you can ask for any size you like.

KB means two different things

Windows counts a KB as 1,024 bytes, so 200 KB is 204,800 bytes and 1 MB is 1,048,576 bytes. macOS and many web tools count it as 1,000, so 200 KB is 200,000 bytes and 1 MB is 1,000,000 bytes. The size box has a switch for this, the exact byte count is always shown before you create the file, and the finished file is described in bytes too. When a limit is unclear, test it both ways.

How the size is reached without breaking the file

A text format such as CSV, JSON, XML, YAML, SQL or a log is written as whole records, and the last record's note field is made as long as it needs to be, so the file still opens in a spreadsheet or parses as JSON. A PDF is a real document (one to 100 pages) with one extra block of data that every reader ignores. A PNG gets one extra chunk and a JPG gets comment sections, both of which viewers skip. A ZIP holds one stored file of random bytes, and a .bin file is random bytes. We check every format with an independent reader, such as JSON.parse, a PDF library, an image decoder and Python's zipfile, at many sizes.

Limits worth knowing

The smallest files are about 89 bytes for a CSV, 803 for a PDF, 81 for a PNG, 124 for a ZIP and about 1,000 for a JPG, because each format needs its own headers. The largest is 200 MiB (209,715,200 bytes): the file is built in memory, and a browser tab runs short beyond that. The content is dummy data. A PDF says only that it is a test page, a JPG is a gradient, and the filler is random, so it does not compress: use a real file when you want to test a compressor, such as the PDF compressor or the image compressor.

Test files and what to do next

Use the generated files to check upload limits, error messages, progress bars, storage quotas and email attachment rules. For ready-made PDF sizes, each with the byte count, upload times and the upload limits that size meets, see the sample PDF files. A stand-in picture of any shape comes from the placeholder image generator, a folder of files can be bundled with zip files online, and a JSON test file can be tidied with the JSON formatter.

Frequently asked questions

How do I create a file of an exact size?
Choose the file type, type the size (or press one of the common sizes such as 200 KB, 1 MB or 25 MB), choose whether 1 KB counts as 1,024 or 1,000 bytes, and press Create file. The page shows the exact number of bytes before and after, and you download a file of exactly that length, named like test-file-5mb.pdf.
Why are there two ways to count a kilobyte?
Windows counts 1 KB as 1,024 bytes and macOS counts it as 1,000, so a 200 KB limit can mean 204,800 or 200,000 bytes. If you are unsure which a form uses, create the file both ways and try them. For a limit test, try the size exactly on the limit and one byte over it using the bytes unit.
Are the files real, valid files?
Yes. The PDF opens with its pages in a PDF reader, the PNG and JPG are real pictures, the CSV, TSV, JSON, JSON Lines, XML, YAML and SQL files parse, and the ZIP opens in archive programs. The contents are dummy data, so a system that inspects the content, such as a virus scanner or a strict document validator, may judge them differently from a real document.
How does it reach an exact size without breaking the file?
Each format has a place where extra bytes are allowed. Text files get a longer last record, a PDF gets one unused data block, a PNG gets one extra chunk that decoders skip, a JPG gets comment sections, a ZIP holds one stored file whose length is chosen to fit, and a .bin file is simply random bytes. The page then checks that the file is exactly the size you asked for before it offers the download.
What are the smallest and largest files I can make?
The largest is 200 MiB, because the file is built in your browser's memory. The smallest depends on the type: about 89 bytes for a CSV, 803 for a PDF, 81 for a PNG, 124 for a ZIP and about 1,000 for a JPG, because each needs its own headers. Plain text and random bytes can be a single byte. The page tells you if a size is too small.
Can I make a file larger than 200 MB?
Not here, because a browser tab holds the whole file in memory while it builds it. On Windows the command fsutil file createnew test.bin 524288000 makes a zero-filled file of that many bytes, and on macOS or Linux dd if=/dev/zero of=test.bin bs=1M count=500 makes a 500 MB one. Those files are empty bytes, not real documents.
Can I use the files to test a compressor?
Only partly. The extra bytes are random on purpose, so they do not shrink, which suits upload and transfer tests but not compression tests: a PDF or ZIP made here will barely get smaller. To test a compressor, use a real PDF or photo.
Is anything uploaded, and does it cost anything?
Nothing is uploaded: the file is built inside your browser and handed to you as a download. It is free, with no account and no watermark, and you can make as many files as you like.

Related tools