What is a TAR File?
A TAR file (short for tape archive) bundles many files and folders into a single file without compressing them. It keeps each file’s name, folder path, permissions, owner and timestamps, which is why TAR is the standard archive format on Linux and other Unix systems. The format dates back to Version 7 Unix in 1979 and is standardized by POSIX as the ustar and pax formats.
Because TAR does not compress, it is usually combined with a compressor: .tar.gz or .tgz (gzip), .tar.bz2 (bzip2) or .tar.xz. Linux, macOS and Windows 10 and 11 all include the tar command.
Download TAR Sample Files
The three TAR samples below contain the same files as our ZIP and RAR samples, so you can compare the formats directly.
TAR Sample File Details
| Sample | Size | Contents |
|---|---|---|
| Sample1.TAR | 3.73 MB | 1 MP3 audio file |
| Sample2.TAR | 30.0 KB | 2 XLSX spreadsheets |
| Sample3.TAR | 3.54 MB | 4 files with a .jpe extension (one-page PDF documents, not JPEG images) |
All three use the POSIX pax format. Each archive starts with a . directory entry (permissions 700), followed by the files stored as ./filename with permissions 644, and is padded to full 10 KB records.
What You Can Test With These TAR Files
- Extraction tools and libraries: including support for pax headers.
- Path handling: entries stored with a
./prefix and a top-level.directory. - Permissions: check that 644 file and 700 directory permissions survive extraction.
- Uploads: forms and APIs that accept
application/x-tar. - Compression comparisons: compress the TAR yourself, or compare it with the identical ZIP and RAR samples.
How to Extract a TAR File
# List the contents without extracting
tar -tvf sample-1.tar
# Extract into the current folder
tar -xvf sample-1.tar
# Compress a TAR file with gzip (creates sample-2.tar.gz)
gzip -k sample-2.tar
The same tar commands work in the Windows 10 and 11 Command Prompt and PowerShell. 7-Zip, PeaZip and WinRAR can also open TAR files.
TAR vs ZIP vs RAR: The Same Files Compared
| Contents (original size) | ZIP | RAR | TGZ | TAR (no compression) |
|---|---|---|---|---|
| 1 MP3 file (3,902,902 bytes) | 3,893,944 bytes | 3,892,989 bytes | 3,888,579 bytes | 3,911,680 bytes |
| 2 XLSX spreadsheets (25,365 bytes) | 20,294 bytes | 20,141 bytes | 16,824 bytes | 30,720 bytes |
| 4 .jpe files (3,701,429 bytes) | 3,578,906 bytes | 3,561,848 bytes | 3,578,399 bytes | 3,706,880 bytes |
TGZ makes the smallest archive for the MP3 and the spreadsheets because gzip compresses all files as one stream, while ZIP and these RAR samples compress each file separately. RAR wins for the images. The differences are small for MP3 and JPEG data, which is already compressed. TAR does not compress at all and pads its output to full 10 KB records, which is why 25 KB of spreadsheets becomes a 30 KB TAR file.






