Generate real, openable test files at any exact byte size โ entirely in your browser. Pick a
format, set a size, and download a structurally valid file in seconds. No server, no signup,
no file size limits from a backend โ just in-browser generation using the File API, Canvas,
and Blob.
Useful for testing upload-limit enforcement, verifying that file-type validators accept
correct MIME types, seeding storage buckets with placeholder assets, and stress-testing
parsers, renderers, and image-processing pipelines with files at controlled sizes.
What test files are for and when you need them
Any system that accepts file uploads has at least three layers to test: size enforcement
(does the backend reject a 51 MB file when the limit is 50 MB?), format validation (does
the parser handle a malformed CSV gracefully?), and rendering fidelity (does the image
viewer display a 4000 ร 3000 PNG without clipping?). Creating real files at exact sizes
by hand is tedious โ you'd need to open an image editor, export at a specific quality
until the byte count lands in range, then repeat for every format.
A dummy file generator solves this by letting you specify the target precisely and get a
valid file immediately. The files are not production content โ they exist solely so your
CI pipeline, QA process, or local dev environment has realistic inputs to work with before
real content is available.
How this tool generates files in-browser
Different formats use different generation strategies, all running in JavaScript with no
server round-trip:
- Image formats (PNG, JPG, WEBP, GIF, BMP). PNG, GIF, and BMP are built
directly as raw bytes โ their binary format structures are assembled in code and filled
with random data, with no canvas involved. JPG and WEBP use an off-screen
OffscreenCanvas filled with random noise and exported via
convertToBlob(), since those formats require a browser encoder.
- PDF. A minimal but structurally valid PDF is assembled as a text string โ
header, catalog, page tree, page object, and cross-reference table โ then padded to hit
the byte target. The result opens in PDF viewers without errors.
- ZIP and GZIP. A local file entry is built by hand using the ZIP local
file header binary format. For GZIP, a standard header is prepended with a deflate-
compressed payload.
- Text formats (TXT, CSV, TSV, JSON, XML, YAML, SQL, MD, LOG). Syntactically
valid content is generated and repeated or truncated to hit the exact byte count.
- BIN. A
Uint8Array of random bytes, useful for testing binary
parsers and raw upload endpoints.
Common testing scenarios
- Upload limit testing. Generate a file 1 byte over your limit and another
1 byte under. Verify that the boundary is enforced correctly and that the error message
is clear.
- MIME type and extension validation. Upload a PNG renamed to .pdf, or a
BIN file with a .jpg extension, to confirm your validator inspects content rather than
just the filename.
- Storage and CDN seeding. Populate S3 buckets, Cloudflare R2, or Supabase
Storage with placeholder assets at representative sizes before real content is ready.
- Parser and renderer testing. Feed a 10 MB CSV to your ingestion pipeline,
a 5 MB PDF to your viewer, or a 50 MB ZIP to your extraction service to confirm behavior
at scale.
- Placeholder image assets. Need a 1920 ร 1080 PNG at roughly 500 KB for
a layout mockup? The
Placeholder Image Generator lets you set exact pixel
dimensions and background color, while this tool targets byte size. Use the right tool
for the right constraint.
Related tools
If you need fake structured data rather than a file of a specific size, the
Fake Data Generator produces realistic rows of
names, emails, dates, and addresses, and exports them as JSON, CSV, or SQL โ useful when
you need the content to look real, not just occupy bytes.
When you need to check the exact size of an existing file or convert between bytes, KB, MB,
and GB, the Bytes / Filesize Converter handles all
binary and decimal unit conversions instantly.
Frequently asked questions
What is a sample or dummy file used for?
Sample files are placeholder files used to test how a system handles real uploads without needing sensitive or production data. Common use cases include: testing file-upload endpoints and validating that size limits, MIME-type checks, and error handling work correctly; seeding storage buckets or CDN directories during development; testing document viewers, image renderers, or parsers with files in specific formats; and load- or performance-testing pipelines by generating files at exactly the sizes your system will encounter in production.
Are the generated files actually valid โ will they open in applications?
Yes. This tool generates structurally valid files, not just files that are padded with zeros and renamed. PNG, GIF, and BMP image files are built as raw bytes (valid format structures filled with random data). JPG and WEBP use an in-browser OffscreenCanvas encoder. PDF files include a minimal but valid document structure. ZIP and GZIP archives are assembled in-browser with real local file headers. Text-based formats (TXT, CSV, TSV, JSON, XML, YAML, SQL, MD, LOG) contain syntactically correct content at the requested size. Binary files (BIN) fill the target byte count with random bytes. All generation runs in your browser โ no server is involved.
What is the maximum file size I can generate?
Up to 250 MB. Because everything runs in browser memory, very large files (above ~100 MB) may be slow to generate on lower-end devices and will hold the file content in RAM until the download completes. If you need files larger than 250 MB for stress-testing, consider generating a 250 MB file and concatenating copies at the OS level. For most upload-limit and parser tests, files between 1 KB and 50 MB are the most practical range.
Which formats are supported?
Twenty formats across five groups. Text: TXT, CSV, TSV, JSON, XML, YAML, SQL, MD (Markdown), LOG. Binary/binary-adjacent: BIN, SVG. Image: PNG, JPG, WEBP, GIF, BMP. Archive: ZIP, TAR, GZIP. Document: PDF. You can set the exact target size using bytes, KB, MB, or use the quick-pick buttons (1 MB, 5 MB, 10 MB, 25 MB, 50 MB, 100 MB) for common test sizes.
Is my data uploaded to any server?
No. Everything happens inside your browser. The file is constructed entirely in JavaScript using the File API, Blob, and Canvas, then handed to the browser for download via a blob URL. No file bytes travel over the network at any point.
How is this different from tools that generate fixed-size files?
Most competing dummy-file generators serve pre-made static files from their server (e.g. a fixed 1 MB or 10 MB binary blob). This tool generates the file on demand in-browser at the exact byte count you specify โ so you can target 2,457,600 bytes for a specific upload-limit test, not just a round number. It also supports real format structure rather than a zero-padded blob renamed to .pdf.
Why do WebP and some image formats require an even width or height?
The WebP and YUV-based codecs used inside the browser's Canvas API require that width and height be multiples of 2 (even numbers) due to chroma subsampling. If you request an odd pixel dimension the tool automatically rounds up by one pixel, which changes the file size slightly from the exact byte target. For byte-exact tests, use formats like PNG, BIN, or TXT that have no such constraint.