How to Open a TAR.GZ File on Mac
June 22, 2026
A .tar.gz file — sometimes shortened to .tgz — shows up constantly in developer tooling, open-source software downloads, and server backups, and it behaves a little differently from a plain ZIP. The good news: macOS actually handles this one natively, in most cases, better than it handles RAR or 7Z. Here's exactly what the format is, how to open it, and where people commonly get confused by its two-step structure.
What does "tar.gz" actually mean?
Unlike ZIP or 7Z, which are single unified formats that both bundle and compress files in one step, TAR.GZ is actually two separate technologies stacked together. TAR (short for "Tape Archive," a name dating back to literal magnetic tape backups in the early Unix era) bundles multiple files and folders into one file — but TAR itself does zero compression. It simply concatenates files together with metadata describing their structure. GZIP is the second half: a compression algorithm that shrinks that combined TAR file down in size. The result, .tar.gz, is a compressed bundle — conceptually similar to what ZIP does in one step, just implemented as two separate, older Unix tools chained together.
This two-part origin is exactly why the format is so dominant in Linux and developer ecosystems: TAR and GZIP are both foundational Unix command-line tools dating back decades, long before ZIP became a cross-platform standard, and that legacy carried forward into how software is packaged and distributed today.
Does macOS open TAR.GZ files natively?
Yes, generally — this is one of the few non-ZIP formats Apple's Archive Utility actually supports out of the box, since macOS is built on a Unix foundation (Darwin) where TAR and GZIP are native, foundational tools rather than third-party additions. Double-clicking a .tar.gz or .tgz file in Finder typically extracts it automatically, the same way a ZIP file does, decompressing and unbundling in a single step without you needing to think about the two-part structure underneath.
When native support doesn't work smoothly
There are a few situations where the built-in handling falls short of what you'd get from a dedicated archive app:
- No preview before extracting — Archive Utility extracts immediately on double-click, with no way to see the contents first, which matters if you're downloading a large server backup or software release and just want to check what's inside
- No progress indicator for very large files — a multi-gigabyte TAR.GZ (common for full backups or large datasets) extracts silently with no visual feedback, which can leave you unsure whether it's still working or has stalled
- Related formats aren't always handled the same way — variants like
.tar.bz2or.tar.xz, which use different compression algorithms (bzip2 and xz respectively) instead of gzip, have inconsistent native support across macOS versions
Using a dedicated archive app instead
A general-purpose archive tool that handles TAR.GZ alongside ZIP, RAR, and 7Z in one consistent interface removes the inconsistency between formats entirely. With Unzipr, TAR.GZ files get the same instant preview, progress indication, and drag-and-drop handling as every other supported format — useful specifically for the large-file and preview-before-extracting cases where Archive Utility's silent, no-feedback extraction falls short.
Opening TAR.GZ via Terminal
If you're already comfortable in Terminal — common among the developer audience that encounters TAR.GZ most often — the command-line approach is genuinely fast and requires no additional software, since tar ships with macOS by default:
tar -xzf yourfile.tar.gz
Breaking down the flags: -x extracts, -z tells tar to decompress using gzip first, and -f specifies the filename that follows. This one command handles both the decompression and unbundling steps in a single pass. For the related .tar.bz2 format, swap -z for -j; for .tar.xz, swap it for -J.
Creating your own TAR.GZ archive
To compress a folder into TAR.GZ format via Terminal:
tar -czf archive.tar.gz /path/to/your/folder
Here -c creates a new archive instead of extracting one, with the same -z and -f flags as before. This is the standard method developers use when packaging source code releases or server backups specifically because it preserves Unix file permissions and ownership metadata more faithfully than ZIP does — a detail that matters for software distribution and system backups, though it's largely invisible for everyday personal file sharing.
Why would you receive a TAR.GZ instead of a ZIP?
Almost always because the file originated from a Linux server, a developer tool's release pipeline, or a command-line workflow, rather than from someone using a Mac or Windows GUI to manually create an archive. Software project releases on platforms like GitHub commonly offer a .tar.gz download option specifically for this reason — it's the native archive format of the Unix/Linux world the software was likely built and tested in.
TAR.GZ versus other Unix-style compressed formats
GZIP isn't the only compression algorithm that pairs with TAR — you'll also encounter .tar.bz2 (using bzip2) and .tar.xz (using xz/LZMA) in the wild, and it's worth knowing roughly how they compare rather than treating them as interchangeable. GZIP prioritizes speed, making it the fastest of the three to both compress and decompress, at the cost of a somewhat lower compression ratio. Bzip2 generally compresses better than gzip but runs noticeably slower, particularly on large files. XZ, which uses the same LZMA algorithm family as 7Z, typically achieves the best compression ratio of the three but is also the slowest to compress, though decompression speed remains reasonable. In practice, most software projects default to .tar.gz specifically because gzip's speed makes it a sensible default for routine releases, reserving xz for cases where minimizing download size matters enough to justify the extra compression time — large Linux distribution images being a common example.
A realistic scenario: installing an open-source developer tool
Picture setting up a new command-line tool that doesn't have a Homebrew formula yet — the project's GitHub releases page offers the source or a prebuilt binary only as a .tar.gz. You download it, and depending on your Mac's Archive Utility behavior for that particular file, it either extracts cleanly into a folder automatically, or sits there as a single file needing a manual Terminal command. This is one of the more common friction points for anyone who primarily uses a GUI-based workflow but occasionally needs to install developer tooling that only ships in Unix-native archive formats — knowing the one-line tar -xzf command removes the need to search for an answer every time it happens.
Troubleshooting common TAR.GZ issues
- "Error opening archive" or a generic failure on double-click: often an incomplete download — verify the file size against the source before assuming the format itself is the problem
- Extraction produces a plain TAR file instead of the final contents: can happen if only the GZIP layer was decompressed without also unbundling the TAR structure underneath — using a dedicated tool or the correct combined Terminal flags avoids this two-step confusion
- Permissions look wrong after extracting on Mac: TAR preserves Unix permission metadata from the original system, which can occasionally produce unexpected file permissions when extracted on macOS — usually harmless for personal files, worth checking for anything you plan to execute or run as a script
Adding a password to a TAR.GZ archive
Since TAR.GZ has no native encryption support, the common workaround for anyone who genuinely needs to password-protect Unix-style archived content is to extract it, then re-compress the extracted contents into a format that does support encryption — ZIP with a password, or 7Z with AES-256 for stronger protection. This two-step process (decompress the TAR.GZ, then re-compress as an encrypted ZIP or 7Z) is standard practice when TAR.GZ content needs to move from a purely internal developer or server context into a scenario where it might be shared more broadly and needs actual access control.
Frequently asked questions
Is TAR.GZ more secure or better than ZIP? Not inherently — TAR.GZ has no built-in encryption or password protection at all, unlike ZIP or 7Z, which both support it. If you need a password-protected archive, TAR.GZ isn't the right choice; use ZIP or 7Z instead.
What's the difference between .tar.gz and .tgz? Nothing functional — .tgz is simply a shorter filename convention for the exact same TAR-then-GZIP format, common on systems with older filename length restrictions.
Can I convert a TAR.GZ to a ZIP file? Yes — extract the TAR.GZ fully first, then re-compress the extracted contents as a ZIP using any archive tool. There's no direct one-step conversion between the two formats.
Why does GitHub offer both a .zip and a .tar.gz download for the same release? To cover both audiences — ZIP for Windows and general users who expect universal compatibility, TAR.GZ for Linux and Unix-based users who expect the format native to their environment and want permission metadata preserved correctly.
The bottom line
TAR.GZ is one of the few archive formats macOS actually handles well natively, thanks to its Unix foundation — but for large files, previewing before extracting, or working alongside ZIP, RAR, and 7Z in one consistent workflow, a dedicated archive app closes the gaps that Archive Utility's bare-bones handling leaves open. Unzipr extracts TAR.GZ alongside every other major archive format, with instant preview and clear progress for large downloads.