.tar

What is a .tar file?

Tape Archive · Archive · Unix (AT&T) · 1979

TAR bundles many files into one without compressing them, a job that dates back to Unix tape backups. It is almost always paired with a compressor like gzip, producing the .tar.gz files common in the Linux and developer world.

Category
Archive
Type
Binary
Also seen as
.gz, .tgz
Is a .tar file safe to open? The archive is safe. Inspect and scan its contents before use.

What is a .tar file used for?

A plain TAR just concatenates files and their metadata into a single stream, preserving permissions and structure. It does no compression on its own.

In practice it is combined with gzip or another compressor, giving .tar.gz (or .tgz) and .tar.bz2 files that are the standard for source code and Linux packages.

You unpack these with the tar command or a graphical archive tool on any platform.

What opens a .tar file?

The .tar format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • 7-Zip
  • WinRAR
  • tar (Windows 10+)

macOS

  • Archive Utility
  • tar
  • Keka

Linux

  • tar
  • Archive Manager

Web

  • Not natively; extract locally

Open a .tar file step by step

  1. Confirm the file really is a .tar. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with 7-Zip or WinRAR.
  3. On Mac, use Archive Utility or tar.
  4. On Linux, try tar or Archive Manager.
  5. Still stuck? Convert the .tar to ZIP, which opens more widely.

Why can't I open my .tar file?

Almost always because no installed app understands TAR. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .tar at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .tar file

You can convert a .tar file to ZIP, 7Z using a conversion tool or the export menu of an app that opens it.

What is the .tar file signature (magic bytes)?

A .tar file carries the hex bytes 75 73 74 61 72 at offset 257, which read as ustar in ASCII. Programs identify TAR by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for TAR. For a full breakdown, see the TAR (ustar) file signature page.

Documented magic-byte signatures for the .tar format
Hex signatureOffsetASCIINote
75 73 74 61 72257ustar'ustar' at offset 257

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .tar file?

TAR bundles many files into one without compressing them, a job that dates back to Unix tape backups. It is almost always paired with a compressor like gzip, producing the .tar.gz files common in the Linux and developer world.

What is a tar.gz file?

It is a TAR archive that has then been compressed with gzip. TAR bundles the files, gzip shrinks the bundle. Extract with tar -xzf or any archive tool.

Related formats