Invalid Test File Generator
Create a file with a chosen extension but intentionally invalid random content for negative tests. Processing takes place locally in your browser.
Start using
Invalid Test File Generator
Choose a positive file size in bytes, KiB or MiB and an output name. The defaults are 1 MiB and damaged-document.pdf; the generated size is floored to a whole byte and cannot exceed 64 MiB.
The content is created with crypto.getRandomValues in chunks. When the file is longer than eight bytes, its first eight bytes spell the ASCII marker CORRUPT! and the remaining bytes stay cryptographically generated random data.
The downloaded Blob uses application/octet-stream regardless of the filename extension. A .pdf name does not make the output a partially damaged PDF; it is deliberately invalid random content intended to exercise upload and error-handling paths.
For a 1 KiB setting, the result is exactly 1024 bytes. Repeating the same settings produces different bytes because there is no seed, template, valid header, checksum or reproducibility option.
Generation stays in the browser and no source file is required. Use only in a controlled test environment; the tool does not repair files, simulate a specific corruption mode or prove that an application handles every malformed document safely.
Processing takes place locally in your browser.