Developer & Data100% Free for AllClient-Side PrivateAuto-saved (3 days)

Sample File Generator

Create placeholder files at any size you specify — sample images, PDFs, DOCX, CSV, JSON, text, and short videos — with randomised content each time. Built for testing upload limits, forms, and file handling.

File type
Image format
Target size
KB

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

  1. Pick a file type — image, PDF, Word, CSV, JSON, plain text, or a short video.
  2. Choose a target size from the presets, or type an exact figure in kilobytes.
  3. Generate. Four different samples appear, each with randomised content so no two look alike.
  4. 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 this tool

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.

Things worth knowing

  • 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?

Yes. Every file opens in its normal application; padding uses regions each format ignores.

Are these real files or just padded junk?

Real files. Each one is generated properly for its format — the PDFs are built with pdf-lib and have actual pages and text, the Word files are valid OOXML, the images are drawn on a canvas. Padding only tops up the final byte count using regions the format specification says to ignore, so every file opens normally.

Why is the video size not exact?

Because it is encoded by the browser's own recorder, which picks a bitrate based on the content, and WebM does not tolerate trailing bytes the way JPEG and PDF do. You choose the duration instead, and the resulting size will be in the right region rather than exact.

Can I get a shareable link to the generated image?

Not a hosted one. This site has no server and stores nothing, so there is nowhere for a file to live at a public URL. What you can copy is a data URL for images under 200KB, which works pasted directly into HTML, CSS, or a Markdown file — self-contained, though much longer than a normal link.

Is anything uploaded?

No. Every file is generated in your browser and written straight to your downloads. Nothing is transmitted.

What is the largest file I can generate?

Sizes into the tens of megabytes work fine. Very large targets take longer and use memory proportional to the file, since the whole thing is held in the tab before download.