View all services
Talk to QA Advisor
Free tool · Test data

Test file generator

Upload limits, file type checks and preview generation all need real files to test against. Build them here at the exact size you need, down to the byte, along with the empty, corrupt, mislabelled and oddly named files that break upload code.

Test file generator

Real files for upload and file-handling tests, built in your browser at exact sizes: PDFs, images, CSV and JSON, audio, video, any file type, and the edge cases that break upload code.

Page size

1,000,000 bytes exactly. MB is 1,000,000 bytes and MiB is 1,048,576. Upload limits use either, so test both.

Choose the options, then create the file.

Ready
How to use

How to use the Test file generator

  1. 1Choose the kind of file: PDF, image, CSV and JSON, audio, video, any file type, or one of the edge cases.
  2. 2Set the size and options. Sizes are exact to the byte, in decimal MB or binary MiB.
  3. 3Create the file. The result shows its exact size, type and first bytes, with a preview where the browser can show one.
  4. 4Download it, renaming it first if the test needs a particular file name.

Why upload tests need files of an exact size

An upload limit is a boundary, so it needs boundary values: a file exactly at the limit, one byte under and one byte over. A limit of 10 MB is tested with files of 9,999,999, 10,000,000 and 10,000,001 bytes, and because some systems mean 10 MiB, also with 10,485,760 and 10,485,761 bytes. A "roughly 10 MB" file from a downloads folder cannot tell you which side of the limit the system really enforces.

Every file here is built to the byte. PDFs are padded with an unused object, PNG and JPEG images with a metadata block that viewers ignore, and CSV and JSON files by filling the last row, so each file is still valid for its format at the exact size you asked for.

Decimal MB or binary MiB

A megabyte means 1,000,000 bytes in the SI sense and 1,048,576 bytes in the binary sense, which is properly called a mebibyte (MiB). Operating systems, browsers, cloud storage and upload libraries disagree on which they mean, and the gap is almost 5% at every step. A file of 10,200,000 bytes is over a 10 MB limit and under a 10 MiB one.

Choose the unit the requirement uses, then test the other one as well. Mismatches between the front end, which often checks in one unit, and the server, which checks in another, are a common source of uploads that pass validation and then fail.

The edge cases that break upload code

Most upload defects come from files that are valid in an unexpected way. An empty file, an image saved with a .pdf extension, a PDF renamed to photo.jpg, a file cut off halfway, a name with no extension, an upper-case extension, a name with emoji or 255 characters: each tests an assumption the code makes about what a file looks like.

The edge cases also cover security checks. A double extension such as report.pdf.exe confirms the filter reads the real extension, and the pixel flood image, a small PNG that decodes to 400 million pixels, confirms the image pipeline limits dimensions before it decodes.

Why random contents matter for size tests

A file of zeros or repeated text compresses to almost nothing. If a proxy, CDN or the browser compresses the upload, a 100 MB file of zeros can arrive as a few hundred kilobytes and never reach the limit you meant to test. Random bytes cannot be compressed, so they test the limit as it is enforced on the wire.

Use random contents for size and timeout tests, and zeros or a text pattern when you want a file that compresses well, for example to check that compression is actually applied.

QAble service

Functional testing

QAble tests upload and file-handling flows end to end, including the size boundaries, file type checks and edge cases that usually reach production untested.

Explore the service
FAQ

Frequently asked questions

Are the files uploaded anywhere?

No. Every file is built in your browser and saved straight to your device. Nothing is sent to a server.

How large a file can I create?

Up to 500 MB for PDFs and binary files, 200 MB for CSV, JSON and text, and 100 MB for padded images. Larger files are better created with a command such as fallocate or mkfile, because a browser holds the whole file in memory.

Are the PDFs real PDFs?

Yes. Each is a valid PDF 1.4 document with real pages and text that opens in any viewer. The padding that sets the size sits in an object no page refers to, so it does not appear on screen.

Why is the PDF bigger than the size I asked for?

A PDF has a minimum size for its number of pages. When the size asked for is smaller than that, you get the smallest valid PDF with that many pages and a note saying so. Fewer pages allow a smaller file.

Can I make a video of an exact file size?

No. Video is encoded by your browser and the encoder decides the size. You choose the resolution and an exact duration instead. For an exact size, use the Any file tab with a .mp4 extension, which suits size checks but will not play.

Need the edge cases found for you?

QAble testers work through the inputs, payment paths and data that break products in production, before your users find them.

Talk to QA Advisor