TAR

What is TAR?

Complete guide to the TAR file format

Year1979
TypeArchive
UsageUnix file packaging

What is it?

TAR (Tape Archive) is a file packaging format originating from Unix in the late 1970s. The name refers to its original purpose: archiving files to magnetic tape drives for backup. TAR bundles multiple files and directories into a single archive file while preserving file system metadata including file permissions, ownership, timestamps, hard links, and symbolic links - attributes that are essential in Unix and Linux environments but which ZIP archives do not reliably preserve.

A plain TAR file does not compress data - it only bundles files together, similar to how you might rubber-band a stack of papers. Compression is applied on top of the TAR archive using separate tools: gzip creates .tar.gz, bzip2 creates .tar.bz2, and xz creates .tar.xz. This separation of concerns (packaging vs. compression) is a Unix design philosophy. TAR archives are the universal distribution format for Linux software source code and system backups.

Technical Specifications

OriginUnix, AT&T Bell Labs, late 1970s
File Extension.tar
MIME Typeapplication/x-tar
CompressionNone (packaging only)
Metadata PreservedPermissions, ownership, timestamps, symlinks, hard links
Common Variants.tar.gz, .tgz, .tar.bz2, .tar.xz
Toolstar command, GNU tar, 7-Zip, WinRAR

Pros & Cons

Advantages

Unix Metadata Preservation

Preserves file permissions, ownership, and symbolic links that are lost in ZIP and other Windows-centric formats.

Universal on Unix/Linux

The tar command is installed on every Unix, Linux, and macOS system by default.

Streaming Support

TAR archives can be streamed directly through pipes, enabling network backup and compression without temporary files.

Flexible Compression Pairing

Pair with any compression tool (gzip, bzip2, xz, zstd) to get the exact speed-to-compression trade-off you need.

Disadvantages

No Built-in Compression

A plain .tar file is often larger than the original files because it adds header overhead without reducing data size.

No Random Access

Extracting a single file from a TAR archive requires reading through the entire archive sequentially.

Limited Windows Support

TAR is not natively supported on Windows outside of WSL and PowerShell, requiring third-party tools like 7-Zip.

Concatenation Behavior

Appending to a TAR archive adds duplicate entries for updated files rather than replacing them, which can cause confusion.

When to Use It

Here are the most common situations where TAR is the right choice:

Linux Software Distribution

Open-source software releases are distributed as tar.gz or tar.xz source packages for compilation.

System Backup

Use tar to create complete backups of Linux filesystem directories including all permissions and ownership metadata.

Docker Image Exports

Docker exports container images as TAR archives using docker save.

Data Transfer Between Unix Systems

TAR is the standard way to package files for transfer between Unix/Linux systems without losing filesystem attributes.

Convert Your Files Online - Free

Our free online converter supports all major formats. No software to install, no registration required.

Start Converting Now

Frequently Asked Questions

Does TAR compress files?

No. A plain TAR file does not compress data - it only bundles files together. To compress, combine TAR with gzip (tar.gz), bzip2 (tar.bz2), or xz (tar.xz).

How do I create a tar.gz file?

Use: tar -czf archive.tar.gz directory/ - The -c flag creates, -z applies gzip compression, and -f specifies the output filename.

How do I extract a TAR file?

Use: tar -xf archive.tar - For compressed variants: tar -xzf archive.tar.gz (gzip) or tar -xJf archive.tar.xz (xz).

Can I open TAR files on Windows?

7-Zip, WinRAR, and the built-in Windows 11 tar command can open TAR files on Windows. The Windows Subsystem for Linux (WSL) also provides native tar support.

What is the difference between TAR and ZIP?

TAR is a packaging format from Unix that preserves file permissions and metadata; ZIP is a combined packaging and compression format from Windows. TAR is compressed separately; ZIP compresses each file individually. TAR is standard on Linux; ZIP is standard on Windows.