Dev
Fake File Metadata Generator
Upload handlers, storage backends, and file management APIs all depend on file metadata — name, MIME type, size, hash, timestamps — but testing these systems without actual files is awkward. This generator produces realistic JSON metadata objects for images, documents, videos, code files, or a mixed set, so you can seed test databases, build fixture files, and mock storage responses without touching real files. The File Category selector scopes output to a specific file type group or mixes them. Images produce .jpg, .png, .webp, and .gif entries with sizes in the 50 KB to 8 MB range and correct MIME types like image/jpeg and image/webp. Documents cover .pdf, .docx, .xlsx, and .txt with sizes from 10 KB to 20 MB and proper application/ MIME types. Videos generate .mp4, .mov, and .webm entries with sizes from 200 KB to 800 MB — realistic enough to trigger size-limit validation. Code files produce .js, .ts, .json, and .py entries with sizes from 1 KB to 500 KB. Every record includes name, extension, mimeType, sizeBytes, sizeKB, sizeMB, a 32-character hex MD5 hash, a 64-character hex SHA-256 hash, createdAt, updatedAt, isReadable, and isWritable. Count goes up to 30 per batch. Hashes are randomly generated hex strings of the correct length — not derived from any actual file content, but correct in format for testing hash storage, deduplication lookups, and display logic.
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Select a file category from the dropdown — choose 'Mixed' to span all types or a specific category like 'Images' to scope the output.
- Set the count field to the number of metadata records you need, between 1 and 50.
- Click Generate to produce the JSON output in the results panel.
- Copy the full JSON array or individual objects and paste into your test fixtures, seed scripts, or API mock files.
- Re-run the generator as many times as needed — each run produces a fresh set of names, sizes, and hash strings.
Use Cases
- •Seeding a Postgres staging database with 50 mixed-category file records to test pagination queries
- •Populating Cypress fixtures for a drag-and-drop file upload component in a React app
- •Mocking S3 ListObjectsV2 responses with realistic image metadata for filtering and sorting tests
- •Testing MIME type validation middleware in an Express or FastAPI file upload endpoint
- •Generating Postman collection examples for a document management REST API
Tips
- →Generate 'Mixed' category records when testing a generic file manager; they expose MIME type handling bugs that single-category runs miss.
- →Pair image metadata records with a placeholder image service like picsum.photos by mapping the generated file name to a URL — you get plausible end-to-end mock data.
- →When testing deduplication logic, generate two separate batches and manually copy one hash from the first batch into the second to simulate a real duplicate collision.
- →Video records carry large byte sizes by design; use them specifically to test size-limit enforcement and upload progress UI components, not as general-purpose filler.
- →The ISO 8601 timestamps work directly in SQL INSERT statements — wrap them in single quotes and they'll parse correctly in PostgreSQL, MySQL, and SQLite without conversion.
- →For Postman collections, generate 6 to 8 records, paste them into a collection variable as a JSON array, and iterate with a forEach pre-request script to run the same request against multiple mock files.
FAQ
are the md5 and sha-256 hashes in the output real or just random strings
They are randomly generated hex strings of the correct length — 32 characters for MD5, 64 for SHA-256 — and do not correspond to any actual file content. They are safe to use for testing hash-storage logic, deduplication lookups, or display formatting, but not for any cryptographic verification.
can I paste this output directly into a jest or vitest fixture file
Yes. Copy the generated JSON array and paste it into a fixture file or mock factory. Each object already includes the fields most upload handlers expect: name, size, MIME type, and hash. If your code uses the browser File API, you may need to rename mimeType to type to match that property convention.
how realistic are the file sizes — will they catch size-limit bugs
Sizes are generated within ranges typical for each category: roughly 50 KB to 8 MB for images, 50 KB to 20 MB for documents, and up to 800 MB for video records. That spread is realistic enough to trigger size-limit validation errors, pagination edge cases, and UI rendering issues that flat or sequential sizes would miss.
what MIME types does each file category produce
Images produce image/jpeg, image/png, image/webp, and image/gif. Documents produce application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document (docx), application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx), and text/plain. Videos produce video/mp4, video/quicktime, and video/webm. Code files produce application/javascript, application/typescript, application/json, and text/x-python.
You might also like
Popular tools from other categories that share themes with this one.
Try these next
More free tools from other corners of the catalog, picked by shared themes.