TAR (tape archive) joins files and folders into one file without compressing them. It is the standard way to package things in the Unix and Linux world: source code releases, server backups, Docker image layers, data exports. Most TAR files you download are compressed afterwards, which gives the double extensions .tar.gz, .tar.bz2, .tar.xz or the short forms .tgz, .tbz2, .txz. A plain .tar is common in backups and in exports from devices and web hosting panels.
History
The tar program appeared in Version 7 Unix in 1979 and wrote archives directly to magnetic tape, hence the name. The format was standardised as ustar in POSIX.1-1988, and POSIX.1-2001 added the extended pax format, which removes the old limits on name length and file size and stores names in UTF-8. GNU tar, the version on most Linux systems, has its own extensions (long names, incremental backups) and also reads and writes pax. Tape drives are rare today, but the format stayed because it describes Unix files completely.
How TAR works
A TAR file is a sequence of 512-byte blocks. Each file gets a header block with its name, size, permissions, owner, group and modification time, followed by its data padded to a multiple of 512 bytes. Two empty blocks mark the end. There is no central table of contents: to list the archive, a program reads it from start to finish.
- No compression of its own. That is deliberate: TAR packs, an external tool such as gzip, bzip2, xz or zstd compresses. Because the whole archive is compressed as one stream, a tar.xz of many similar files can be much smaller than a ZIP.
- Full Unix metadata: permissions (including the executable bit), owners, symbolic and hard links, device files. This is why system backups and software packages use TAR and not ZIP.
- Name limits: the old format allows 100 bytes per path, ustar up to 256, pax practically unlimited. Very old tools may cut off long paths.
Opening TAR files
Windows 10 and 11 include the command tar (since 2018): tar -xf archive.tar in the command prompt extracts it, also for .tar.gz. Windows 11 opens TAR, tar.gz and tar.xz in File Explorer since version 23H2 and can create TAR since 24H2. 7-Zip works on any Windows, for a .tar.gz it first shows the .tar inside. macOS: double-click in Finder, or tar -xf in Terminal. Linux: tar -xf archive.tar; for a listing tar -tvf.
Common problems
"tar: This does not look like a tar archive"
The file is compressed or incomplete. Check the real type with file archive.tar. A file named .tar that is actually gzip-compressed is extracted by modern GNU tar automatically with -xf; older versions need -xzf.
Extracted program will not run on Linux, permission denied
The archive was repacked through ZIP or a Windows tool on the way and lost the executable bit. Run chmod +x on the file, or ask for the original TAR.
Error with long file names or "file name too long" on Windows
Linux paths can be longer than the classic Windows limit of 260 characters. Extract closer to the drive root (for example C:\x) or enable long paths in Windows.
Owner warnings when extracting as root
As root, tar restores the stored owners. If you do not want that, add --no-same-owner.
Converting TAR
Typical reasons: TAR to ZIP for someone on Windows or a phone, TAR to tar.gz, tar.xz or 7z to save space, since a plain TAR is not compressed at all. Our converter extracts the archive and packs the content again; the file contents stay identical. What does not survive: owners and groups (they are replaced by the converter's own user), in ZIP also empty folders, and symbolic links and permissions are not guaranteed. For system backups therefore stay with TAR and compress it with your own tools. Limits are 100 MB per upload and 2 GB of unpacked data. We do not create RAR.
| TAR in brief | |
|---|---|
| Origin | Bell Labs, Version 7 Unix |
| First release | 1979 |
| Standard | POSIX.1-1988 (ustar), POSIX.1-2001 (pax) |
| Type | uncompressed archive (container) |
| Compression | none; externally gzip, bzip2, xz, zstd |
| MIME type | application/x-tar |
| Typical use | Linux software, backups, data exports |
More: tar format family (Library of Congress) and the GNU tar manual.