What is TAR?
Complete guide to the TAR file format
Last updated:
What is TAR?
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.
How TAR Works
The name tar is short for tape archive, and that origin explains everything about the format. A .tar file bundles many files and directories into one continuous stream so they can be written to a backup tape, or today a single disk file, in one pass. The crucial point is that tar does no compression at all: a tarball is roughly the same size as the sum of its contents. Its job is packaging, not shrinking.
The format is deliberately simple. Each file in the archive is preceded by a fixed-size header block of 512 bytes containing the filename, size, permissions, owner and group, and modification time, followed by the file's raw contents padded up to a multiple of 512 bytes. The archive is just these header-and-data pairs laid end to end, with a run of zero blocks marking the end. Because it stores full Unix metadata, tar faithfully preserves permissions, symlinks, and ownership, which is exactly why it remains the backbone of Unix backups.
That streaming design is tar's superpower and its limitation. Because there is no central index, tar can create or extract an archive while reading a single continuous flow of bytes, which is ideal for piping. The flip side is that finding one file deep in a large tarball means scanning from the start, since there is no directory to jump to.
To get a compressed archive you pipe tar's output through a compressor. This is why the compound extensions .tar.gz, .tar.bz2, and .tar.xz are so common: tar builds the single stream and gzip, bzip2, or xz squeezes it. The famous tar czf archive.tar.gz files/ command does both steps at once, the z invoking gzip.
History and Standardization
tar dates back to the 1970s Unix era, when magnetic tape was the primary backup medium and an archive naturally meant a serial stream. The format long outlived the hardware it was named for, becoming the default way to move collections of files around the Unix world.
Over the decades several header variants appeared, and the format was standardized as part of POSIX. The widely used ustar format and the later pax extended format resolved early limits on filename length and file size, and modern tar implementations such as GNU tar and bsdtar interoperate around these agreed layouts.
Because it is simple, stable, and openly specified, tar support is universal on Unix-like systems and is built into most cross-platform archive tools. It underpins software distribution, container image layers, and backup systems, and its role as the packaging half of the tar-plus-compressor pairing keeps it in constant daily use.
TAR Compared to ZIP and 7z
The biggest conceptual difference from ZIP is division of labour. ZIP both archives and compresses each file individually inside one container, and it keeps a central directory for fast random access. tar only archives, leaving compression to a separate tool, and has no index. This makes tar better at streaming and at preserving Unix metadata, while ZIP is better for quickly extracting a single file from a large archive.
tar's separation of jobs gives it one real advantage over ZIP's per-file compression: because a compressor sees the whole concatenated stream at once, it can exploit redundancy across many small similar files, so a .tar.gz of a source tree often ends up smaller than the equivalent ZIP. The cost is that you cannot extract one file without decompressing up to its position.
Against 7z, tar again differs by philosophy: 7z is an all-in-one archiver with strong LZMA compression and an index, whereas tar leans on the Unix toolchain. On Windows, ZIP and 7z dominate; on Linux and macOS, tar plus a compressor remains the idiomatic choice, especially where preserving exact permissions and ownership matters.
Technical Details
TAR vs Other Archive Formats
| Feature | TAR | ZIP |
|---|---|---|
| Role | Bundling only[3] | Bundle + compress |
| Built-in compression | None[1] | DEFLATE |
| Unix metadata | Preserved[2] | Limited |
| Per-file access | Sequential | Random |
| Best for | Unix archiving pipelines | Cross-platform sharing |
TAR only bundles files and is usually paired with gzip or xz, whereas ZIP bundles and compresses in a single step.
Pros and Cons
Advantages
Preserves file permissions, ownership, and symbolic links that are lost in ZIP and other Windows-centric formats.
The tar command is installed on every Unix, Linux, and macOS system by default.
TAR archives can be streamed directly through pipes, enabling network backup and compression without temporary files.
Pair with any compression tool (gzip, bzip2, xz, zstd) to get the exact speed-to-compression trade-off you need.
Disadvantages
A plain .tar file is often larger than the original files because it adds header overhead without reducing data size.
Extracting a single file from a TAR archive requires reading through the entire archive sequentially.
TAR is not natively supported on Windows outside of WSL and PowerShell, requiring third-party tools like 7-Zip.
Appending to a TAR archive adds duplicate entries for updated files rather than replacing them, which can cause confusion.
When to Use TAR
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 TAR Files
Need to convert your TAR files? Use our free online converter.
Try Archive Converter FreeHow to open a TAR file
TAR files, commonly used in Unix and Linux environments, can be handled by a variety of software tools ranging from professional applications to free and open-source options. Professional tools often provide advanced features for managing large archives, while free and open-source solutions cater to users looking for straightforward extraction and viewing capabilities. Browser-based tools offer convenience for quick access without installation, while built-in system utilities provide basic functionality for users who prefer not to use third-party software.
When choosing software for TAR files, key decision factors include the fidelity of file handling, whether the tool supports editing or is limited to viewing, and the overall cost model. Platform compatibility is also crucial, as some tools are restricted to specific operating systems. Additionally, users should consider their export needs, as some applications allow for conversion to other formats, which can be beneficial when sharing files with users who may not have TAR support.
WinRAR 6.20
WinRAR is a powerful archive manager that supports TAR files among various other formats. It allows users to create, manage, and extract TAR archives with high fidelity, ensuring that file permissions and metadata are preserved during the process.
- Create and extract TAR archives
- Preserve file permissions and metadata
- Multi-volume archive support
- Strong AES-256 encryption
- Integrated file repair tool
- Robust compression algorithms
- User-friendly interface
- Comprehensive format support
- Paid software after trial period
- Limited editing capabilities
Exports to: ZIP, RAR, 7Z, ISO
Best for: Choose WinRAR for a comprehensive and user-friendly solution for managing TAR files with advanced features.
Visit WinRAR →7-Zip 22.01
7-Zip is a free and open-source file archiver that excels in handling TAR files. It offers a high compression ratio and supports extraction and creation of TAR archives, making it a versatile tool for users who need to manage various archive formats.
- Create and extract TAR files
- High compression ratio
- Support for multi-format archives
- Command line interface for automation
- File integrity check
- Completely free and open-source
- Lightweight and efficient
- Strong community support
- Limited GUI compared to competitors
- Less intuitive for beginners
Exports to: ZIP, GZ, TAR.GZ, WIM
Best for: 7-Zip is ideal for users seeking a free, powerful tool for managing TAR files without the need for extensive features.
Visit 7-Zip →The Unarchiver 4.3.0
The Unarchiver is a simple and effective tool for macOS users to extract TAR files and other archive formats. It focuses on ease of use, allowing users to quickly access the contents of TAR archives without complex settings or configurations.
- Extract TAR and other archive formats
- Support for various compression methods
- Integration with Finder for easy access
- Automatic file association
- Preserves original file structure
- User-friendly interface
- Quick extraction process
- Lightweight and efficient
- No archive creation capabilities
- Limited to macOS platform
Exports to: N/A
Best for: The Unarchiver is perfect for macOS users who need a straightforward tool for extracting TAR files without additional features.
Visit The Unarchiver →PeaZip 9.2.0
PeaZip is a free file archiver that supports TAR file management among many other formats. It provides a graphical interface for creating and extracting TAR files, along with advanced features like file encryption and batch processing.
- Create and extract TAR files
- File encryption and secure deletion
- Batch processing for multiple files
- Customizable user interface
- Portable version available
- Feature-rich with encryption options
- Cross-platform compatibility
- Open-source with active development
- More complex interface for beginners
- Performance can vary with large files
Exports to: ZIP, 7Z, ARC, GZ
Best for: PeaZip is suitable for users who need a versatile and feature-rich tool for handling TAR files, especially those who value security.
Visit PeaZip →