Free RAR test files and sample generator
Proprietary archive format with recovery records and multi-volume support. Common for distributed downloads.
What is a .rar file?
RAR: Roshal Archive. RAR is the archive format behind WinRAR, still widely distributed despite ZIP's ubiquity, partly for its strong compression, partly for split volumes that let a huge archive travel as a set of numbered parts. RAR 5.0 keeps its file index in headers spread through the archive, each protected by its own CRC32, so a reader can detect damage in one entry without discarding the rest.
Why generate a test RAR file?
- Test archive intake that must accept more than ZIP.
- Exercise an extractor, malware scanner or attachment filter.
- Check handling of an archive whose single entry is empty.
How a .rar file is identified
Every .rar file begins with 52 61 72 21 1A 07, "Rar!" followed by two control bytes. That is what a validator inspecting content rather than the file name looks for.
Negative testing with broken RAR files
- Invalid. Identifiable, but wrong inside, so it fails during parsing.
- Corrupted. The leading bytes are destroyed, so the
52 61 72 21 1A 07identifying a .rar is gone. Same length as the valid file. - Incomplete. Truncated part-way, so it is genuinely shorter.
- Empty. Chosen under Content rather than File Condition: valid structure, no data.
Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.
Sample RAR content
[Archive], multi-volume, recovery record 5%.
This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.
How to open and verify the file
Extract with WinRAR, 7-Zip, or `tar -xf file.rar` on Windows 10+ and most Linux distributions, all of which read RAR5. Files from here use the store method: RAR's compression is proprietary, but the container format is published, so the archive is genuinely valid. Its contents are simply not compressed.
Media type application/octet-stream · extension .rar · category Archives
Generate a .rar file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about RAR files
What identifies a .rar file?
A .rar file begins with the bytes 52 61 72 21 1A 07, "Rar!" followed by two control bytes. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.
Can I download several broken RAR files at once?
Yes, select more than one File Condition and you get one ZIP containing a .rar per condition, each named after its condition.
Can the RAR file use UTF-16 or a byte-order mark?
No, and deliberately. A .rar file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.
How do I open or verify the RAR file?
Extract with WinRAR, 7-Zip, or tar -xf file.rar on Windows 10+ and most Linux distributions, all of which read RAR5. Files from here use the store method: RAR's compression is proprietary, but the container format is published, so the archive is genuinely valid. Its contents are simply not compressed.