Free TAR test files and sample generator
The standard Unix archive format that bundles files without compression. Often paired with gzip as .tar.gz.
What is a .tar file?
TAR: Tape Archive. TAR is the Unix archive format, a plain concatenation of files with 512-byte headers and no compression of its own. It preserves permissions and symlinks, which is why it remains the basis of Unix packaging and container images.
Why generate a test TAR file?
- Test extraction in a Unix deployment or container build.
- Verify permission and path handling on extract.
- Check multi-file archive processing.
What you can put inside a .tar file
You get 4 content options for TAR, so the file holds something meaningful rather than random padding: Text files, Mixed file types, Nested folders, Many small files. Pick several and they are merged into one file, with a section, sheet, slide or folder for each.
How a .tar file is identified
Every .tar file begins at offset 257 with 75 73 74 61 72, "ustar" at offset 257, inside the first file header, not at the start of the file. That is what a validator inspecting content rather than the file name looks for.
How the size lands on the exact byte
A tar is a whole number of 512-byte blocks, so the size is set by the entries and the zero blocks that terminate the archive.
Negative testing with broken TAR files
- Invalid. Identifiable, but wrong inside, so it fails during parsing.
- Corrupted. The leading bytes are destroyed, so the
75 73 74 61 72identifying a .tar 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 TAR content
[Archive], ./bin, ./config.yaml, ./data/
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
List with `tar -tvf file.tar`, or open with 7-Zip on Windows.
Media type application/x-tar · extension .tar · category Archives
Generate a .tar file → · questions about sizes, privacy or cost are answered on the site FAQ.
Frequently asked questions about TAR files
What identifies a .tar file?
A .tar file begins at offset 257 with the bytes 75 73 74 61 72, "ustar" at offset 257, inside the first file header, not at the start of the file. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.
How can a .tar file be an exact number of bytes?
A tar is a whole number of 512-byte blocks, so the size is set by the entries and the zero blocks that terminate the archive.
What can go inside the TAR file?
There are 4 content options for .tar: Text files, Mixed file types, Nested folders, Many small files. Choose more than one and they are combined into a single file, a section, sheet, slide or folder per option, rather than downloaded separately.
Can I download several broken TAR files at once?
Yes, select more than one File Condition and you get one ZIP containing a .tar per condition, each named after its condition.
Can the TAR file use UTF-16 or a byte-order mark?
No, and deliberately. A .tar 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 TAR file?
List with tar -tvf file.tar, or open with 7-Zip on Windows.