What is a TAR file?
A TAR gathers a folder of files into one file, keeping names, folders and permissions intact. It does not make anything smaller by itself, which is why you nearly always see it paired with gzip as a .tar.gz. You can convert TAR files here, both into the format and out of it.
Specification
| Full name | Tape Archive |
|---|---|
| Extensions | .tar |
| Media type | application/x-tar |
| Compression | Uncompressed |
| Transparency | — |
| Animation | — |
| Multiple pages | Supported |
| Colour depth | 512-byte headers, no compression, POSIX ustar and GNU variants |
| Size limits | — |
| Introduced | 1979 |
| Developed by | AT&T Bell Labs, later POSIX |
| Standard | Open |
| Browser support | Not displayed by browsers |
What TAR is used for
- Packaging source code and Unix software releases
- Backups that must preserve permissions, ownership and symbolic links
- Docker and OCI image layers, which are tar streams
- Piping a directory tree over a network or into another command
Strengths and limitations
What TAR does well
- Preserves Unix permissions, ownership, links and timestamps exactly
- Streams cleanly, so it can be piped without ever touching disk
- Format is simple and stable enough to still read tapes from the 1980s
Where TAR falls short
- No compression on its own, so it is almost always paired with gzip or xz
- No central index, so listing contents means reading the whole archive
- Extracting one file from a compressed tar requires decompressing up to it
Convert TAR to
Every target this format can be written out as, each on its own page.
Convert to TAR
Everything that can be turned into a TAR file.
Tools that accept TAR
Questions about TAR
What is a .tar file?
A TAR gathers a folder of files into one file, keeping names, folders and permissions intact. The extension .tar identifies it, and its media type is application/x-tar.
How do I open a TAR file?
Browsers do not display TAR natively, so you either need software that understands it or you convert it to something more common first. Converting is usually the faster route when you only need to look at the contents once.
Is TAR lossy or lossless?
Uncompressed. Nothing is discarded, so repeated saves never degrade the contents.
What is TAR good for?
Preserves Unix permissions, ownership, links and timestamps exactly. Streams cleanly, so it can be piped without ever touching disk. Format is simple and stable enough to still read tapes from the 1980s. In practice that makes it a good fit for packaging source code and Unix software releases, and Backups that must preserve permissions, ownership and symbolic links.
What are the drawbacks of TAR?
No compression on its own, so it is almost always paired with gzip or xz. No central index, so listing contents means reading the whole archive. Extracting one file from a compressed tar requires decompressing up to it.