tar vs ZIP: What's the Difference and Which Should You Use?
tar vs ZIP: What's the Difference and Which Should You Use?
Almost every confusion about tar vs ZIP dissolves once you accept one fact: tar does not compress anything.
That is not a limitation someone forgot to fix. tar is a Tape ARchive — it was written in 1979 to write files sequentially onto magnetic tape, and its job was to bundle many files into one stream while preserving their metadata. Compression was a separate concern, handled by a separate program.
ZIP, arriving a decade later in 1989, bundled both jobs into one format.
Every practical difference between them descends from that split.
The Structural Difference
ZIP compresses each file individually as it packs it, then writes a central directory at the end listing every entry and its byte offset.
tar concatenates files with headers into one continuous stream, uncompressed. To make it smaller you then run the whole stream through a separate compressor — gzip, bzip2, xz, or zstd — producing .tar.gz, .tar.bz2, .tar.xz, .tar.zst.
That naming is not decoration. .tar.gz literally means "a tar archive that has been gzipped," in that order.
The consequence is the thing to remember: tar.gz is a solid archive; ZIP is not.
| tar.gz | ZIP | |
|---|---|---|
| Compresses | Whole stream at once | Each file separately |
| Cross-file redundancy | Exploited | Not visible |
| Extract one file | Decompress up to it | Seek directly |
| Unix permissions | Native | Partial, unreliable |
| Symlinks, hard links | Preserved | Poorly supported |
| Corruption impact | Everything after the damage | Just that file |
| Built-in encryption | None | Yes |
| Streamable | Yes | Needs seekable output |
| Universal support | Unix, recent Windows | Everywhere |
Solid Compression: Why tar.gz Often Wins on Size
Because gzip sees the tar stream as one long run of bytes, it finds repetition that spans file boundaries. Compress a hundred header files that all share the same licence block and similar includes, and gzip stores that shared material roughly once.
ZIP cannot do this. Each file is compressed in isolation, so the same licence block gets compressed a hundred separate times. The compressor never learns that it has seen it before.
The size gap this opens is entirely dependent on content:
tar.gz clearly ahead: source trees, log directories, many small text or config files, anything with heavy repetition across files.
Roughly equal: a few large, dissimilar files.
Neither wins: already-compressed content — JPEG, PNG, MP4, MP3. Both formats will bundle them and shrink them by a percent or two. This is the same wall archivers always hit, and covered in 7z vs ZIP and 7-Zip vs WinRAR.
The tradeoff is unavoidable: solid compression buys size by giving up random access.
Random Access: Why ZIP Extracts Faster
ZIP's central directory means a tool can read the index, jump to a byte offset, and decompress a single file without touching the rest of the archive. Pulling one document out of a 5 GB ZIP is nearly instant.
tar.gz has no index and no way to start decompressing mid-stream. To reach the last file, gzip must decompress everything before it. On a large archive, extracting one small file means reading and decompressing gigabytes to get to it.
This is why ZIP underpins so many formats that need to be opened partially — .docx, .xlsx, .jar, .epub, and .apk are all ZIP archives underneath. Software that needs one component out of a package cannot afford to decompress the whole thing.
If your archive is something you will reach into repeatedly, that argument outweighs a size difference.
Metadata: Where tar Is Simply Better
tar was designed to back up Unix filesystems, and it stores what that requires as a core part of the format:
- Permissions (the full mode bits)
- Owner and group, by both ID and name
- Symbolic links and hard links, as links rather than duplicated content
- Timestamps
- Device nodes, FIFOs, and other special files
ZIP's handling is weaker. The specification allows Unix permissions in extra fields, and Info-ZIP writes them, but support is inconsistent — plenty of tools, especially on Windows, silently drop them. Symlinks are worse: many ZIP implementations follow the link and store a copy of the target file instead of the link itself.
For sharing documents none of this matters. For backups, deployments, or anything where the extracted result must behave like the original, it matters completely. Restore a ZIP of a Unix system and you may get correct file contents with the executable bit stripped off every binary.
Corruption Behaves Differently
A worthwhile consideration for anything archived long-term.
ZIP damage is localised. Each file is compressed independently, so a corrupted region typically destroys one entry. The rest usually still extracts, and if the central directory survives, tools can list everything.
tar.gz damage propagates. The gzip stream is continuous — corruption partway through can render everything after that point unrecoverable, because the decompressor loses its state and cannot resynchronise.
Neither format has error correction. This is where WinRAR's recovery records genuinely stand alone, as covered in 7-Zip vs WinRAR. If you are archiving to media you do not fully trust, use a format with recovery data or store checksums separately.
Compressor Choice for tar
Because compression is a separate step, tar lets you pick:
gzip (.tar.gz, .tgz) — the default. Fast, universally available, moderate ratio. When in doubt, this.
bzip2 (.tar.bz2) — better ratio than gzip, considerably slower both ways. Largely superseded by xz.
xz (.tar.xz) — best ratio of the common options, using LZMA2, the same family behind 7z. Slow to compress, reasonable to decompress. Standard for Linux source releases where the archive is built once and downloaded many times.
zstd (.tar.zst) — the modern pick. Near-gzip speed at near-xz ratios, and very fast decompression. Increasingly the default in Linux distributions.
ZIP offers no equivalent choice. It is DEFLATE in practice — the same algorithm gzip uses, applied per file. Some tools support newer methods in ZIP containers, but compatibility drops immediately when you use them, which defeats the entire reason to pick ZIP.
Platform Support
ZIP works everywhere. Windows Explorer, macOS Finder, every Linux desktop, every phone, every webmail preview. Zero installation, zero explanation.
tar.gz is native on macOS and Linux — tar -xzf archive.tar.gz, or double-click in Finder. Windows 11 added built-in tar, gzip, 7z and RAR extraction in late 2023. Windows 10 needs 7-Zip.
That Windows support is recent enough that it should not shape your decision when sending files outward. Plenty of machines still run Windows 10, and plenty of recipients will not know what to do with a .tar.gz regardless of whether their OS technically handles it.
Which to Use
Use ZIP when:
- You are sending the archive to another person
- The recipient's platform is unknown
- Someone needs to extract individual files
- You need password protection without extra tooling
- It is going into a web upload, an email, or a support ticket
Use tar.gz when:
- It stays in a Unix environment
- Permissions, ownership, or symlinks must survive
- You are backing up or deploying
- You are distributing source code
- You are streaming it over a pipe or SSH, where ZIP's need for seekable output is a genuine obstacle
The default that serves most people: ZIP for sharing, tar.gz for systems. If you are choosing among archive tools rather than formats, the best zip program and the best archive tools for Mac cover the field, and compressing files on Mac covers the built-in options.
Neither Will Shrink Your Media
Worth restating, because it is the most common disappointment with both formats.
Archiving a folder of photos or videos and getting back something nearly the same size is not a failure. JPEG, PNG, MP4 and MP3 are already compressed. Their redundancy is gone, and a general-purpose compressor — gzip, DEFLATE, or anything else — has nothing left to work with. See lossy vs lossless compression for why.
Making media smaller requires re-encoding it, which is a different operation from archiving. Compresto compresses video, images and PDFs on macOS in batch — drop in a folder, choose a quality level or a target file size, and it re-encodes with hardware acceleration instead of merely bundling.
Related: how to compress large files and reduce file size on Mac.
Frequently Asked Questions
What is the difference between tar and ZIP?
tar is an archiver only — it bundles files and preserves their metadata but performs no compression. ZIP archives and compresses in one step, compressing each file individually. That is why .tar.gz exists: gzip is a separate pass over the finished tar stream.
Is tar.gz smaller than ZIP?
Usually. tar.gz compresses the whole archive as one stream, so repetition across files is exploited; ZIP compresses each file in isolation and cannot see it. The gap is largest on many similar small files, such as source code, and negligible on a few large dissimilar ones.
Which is faster, tar.gz or ZIP?
Comparable to create. ZIP is far faster to extract a single file, because its central directory allows seeking straight to it. tar.gz must decompress everything preceding that file.
Should I use tar or ZIP on a Mac?
ZIP for anything you are sending to someone else — it opens everywhere with no software. tar.gz for backups, deployments, and anything staying in Unix where permissions and symlinks must survive.
Does ZIP preserve Unix file permissions?
Partially and unreliably. The format allows it and Info-ZIP writes it, but many tools, particularly on Windows, discard it. tar stores permissions, ownership and links as a core part of the format.
Can Windows open tar.gz files?
Windows 11 has extracted tar and gzip natively since late 2023. Windows 10 needs 7-Zip. Because that support is recent, ZIP is still the safer choice for unknown recipients.
What is the difference between .tar.gz and .tgz?
Nothing. .tgz is an abbreviation of .tar.gz, originally for filesystems limited to three-character extensions. Same format, same contents, same tools.