A tar file bundles multiple files and folders into a single archive, but does not compress them

A tar file is a container that holds other files and folders in one package. The name comes from "tape archive," because the format was originally designed to back up data to magnetic tape. Unlike ZIP files, a tar file by itself does not make the contents smaller — it just groups them together. You will often see tar files with names ending in .tar, or paired with compression like .tar.gz or .tar.bz2, which means the tar archive has been compressed afterward.

The main reason tar files exist is to preserve folder structure and file permissions when moving data between computers, especially between different versions of Unix and Linux. If you download software source code or backups from a server, you will encounter tar files regularly. On Windows and Mac, you may never need to create one yourself, but you will need to know how to open them.

Key Takeaways

  • A tar file groups multiple files and folders together but does not shrink them unless paired with compression like gzip or bzip2.
  • On Mac, double-clicking a tar file opens it automatically; on Windows, you need a tool like 7-Zip, WinRAR, or the built-in tar command in Windows 11.
  • Tar files preserve folder structure and file permissions, which is why they are standard for sharing source code and backups on Linux and Unix systems.
  • A filename ending in .tar.gz means the tar archive was compressed with gzip, making it smaller for download.

How tar files differ from ZIP files

Both tar and ZIP bundle files together, but they work differently. A ZIP file compresses the contents as part of the format itself — when you create a ZIP, the files inside get smaller. A tar file does not compress; it just wraps files together. This is why you often see .tar.gz files: the tar bundles the files, then gzip compresses the result.

ZIP is more common on Windows and Mac for everyday use because it is built into both operating systems. Tar is the standard on Linux and Unix servers because it preserves file permissions and ownership, which ZIP does not always do correctly. If you are downloading a backup from a web server or source code from a developer, tar is what you will get.

Opening a tar file on Mac

On Mac, opening a tar file requires almost no work. Double-click the .tar file or the .tar.gz file in Finder, and macOS will extract it automatically using the built-in Archive Utility. The extracted files appear in the same folder as the original tar file.

If double-clicking does not work, open Terminal, navigate to the folder containing the tar file, and type tar -xf filename.tar or tar -xzf filename.tar.gz. The -x flag means extract, and the -z flag tells tar to decompress gzip files. After you press Enter, the files will be extracted to the current directory.

Opening a tar file on Windows

Windows does not have built-in tar support in older versions, but Windows 11 added a native tar command to PowerShell. Open PowerShell, navigate to the folder with your tar file, and type tar -xf filename.tar or tar -xzf filename.tar.gz. The extracted files appear in the same folder.

If you are using Windows 10 or earlier, download a free tool like 7-Zip or WinRAR. Both can open tar files directly — right-click the tar file, select "Extract" or "Open with," and choose your tool. 7-Zip is free and open-source; WinRAR is paid but includes a trial period. After extraction, the files appear in a new folder.

Understanding tar file names and compression

The file extension tells you what is inside. A file named archive.tar contains uncompressed files bundled together. A file named archive.tar.gz contains files bundled in a tar, then compressed with gzip. A file named archive.tar.bz2 is the same idea but compressed with bzip2, which is slower but compresses more. All three extract the same way — your tool detects the compression automatically.

The compressed versions (.tar.gz and .tar.bz2) are much smaller for download, which is why they are more common online. If you are downloading a large software package or backup, the file size difference can be significant. Once extracted, all three produce the same folder structure and files.

When you might encounter a tar file

Tar files are standard in several situations. Open-source software projects on GitHub and SourceForge often offer tar.gz downloads alongside ZIP. Linux system administrators use tar to back up entire directories while preserving permissions. Web hosting providers sometimes let you download site backups as tar files. If you work with developers or manage a server, you will see them regularly.

On a personal computer, you may never need to create a tar file yourself. But knowing how to open one means you can download and use software, backups, and data from any source without being blocked by an unfamiliar format.

Frequently Asked Questions

Is a tar file the same as a ZIP file?

No. Both bundle files together, but ZIP compresses them as part of the format, while tar does not. Tar files are often paired with gzip or bzip2 compression afterward, creating .tar.gz or .tar.bz2 files. Tar is standard on Linux and Unix; ZIP is standard on Windows and Mac.

Why does my tar file have a .gz extension?

The .gz means the tar archive was compressed with gzip to make it smaller for download. When you extract it, your tool automatically decompresses it first, then unpacks the tar. You do not need to do anything different — just extract normally.

Can I open a tar file without special software on Windows?

Yes, if you have Windows 11. Open PowerShell and use the tar command. On Windows 10 and earlier, you need a tool like 7-Zip or WinRAR, both of which are free or inexpensive and work with a right-click menu.

What happens to file permissions when I extract a tar file?

On Mac and Linux, tar preserves the original file permissions during extraction. On Windows, permissions are usually ignored because Windows uses a different permission system. If you extract a tar file on Windows and move it to a Linux server, the permissions may not be what the creator intended.

Can I create a tar file myself?

Yes. On Mac and Linux, open Terminal and type tar -cf archive.tar foldername to bundle a folder. On Windows 11, use the same command in PowerShell. On older Windows, use 7-Zip or WinRAR to create one through the right-click menu, though most people use ZIP instead.