Sample File Generator
Generate dummy images, PDFs, Word files, CSV, JSON, and video at an exact file size for testing uploads.
Runs in your browser. Nothing you add is uploaded.
What the Sample File Generator does
Testing an upload form means finding a file of the right size, and hunting through your downloads folder for something near 2MB wastes a morning. This generates one to order: pick a type and a size and you get four freshly randomised files that are genuinely valid — the images open in an image viewer, the PDFs in a reader, the Word files in Word.
How to generate a sample file
- Pick a file type — image, PDF, Word, CSV, JSON, plain text, or a short video.
- Choose a target size from the presets, or type an exact figure in kilobytes.
- Generate. Four different samples appear, each with randomised content so no two look alike.
- Download the one you want, or copy a small image as a data URL to paste straight into HTML or CSS.
The Sample File Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.
When to use it
Testing an upload limit
A form that claims to reject files over 2MB needs a file just under and just over that line. Generating both takes seconds and tells you whether the validation actually works.
Filling a design or demo with placeholder media
Randomised gradient images at the right dimensions stand in for real photography while a layout is still being built, without licensing anything.
Exercising a file pipeline
Storage quotas, virus scanners, thumbnail generators, and progress bars all behave differently on a 10KB file and a 10MB one. Having both on demand makes those paths easy to check.
Good to know
- The size is exact. Content is scaled close to the target, then the file is padded using bytes each format ignores — after JPEG's end marker, after a PDF's %%EOF, after a ZIP's central directory.
- Video is the exception: MediaRecorder chooses its own bitrate and the container cannot be padded, so length is what you control rather than size.
- Recording video happens in real time — a five-second clip takes five seconds.
- Every generation is random, so hitting Generate again gives you completely different files at the same size.
Frequently asked questions
Are the files a real, valid format?
Are these real files or just padded junk?
Why is the video size not exact?
Can I get a shareable link to the generated image?
Is anything uploaded?
What is the largest file I can generate?
Related tools
MIME Type Lookup
Find the MIME type for any file extension, and back.
Regex Builder
Build a regular expression from blocks, with live matches.
SQL Formatter
Format, beautify, and minify SQL queries for Postgres, MySQL, and SQLite.
JSON to YAML Converter
Convert bidirectional JSON to YAML and YAML to JSON with presets.