tar.gz vs tar.xz
A side-by-side feature comparison.
Summary
Both are tarballs — the difference is the compressor. tar.gz uses DEFLATE and is fast; tar.xz uses LZMA2 and produces much smaller files at the cost of CPU time.
Feature comparison
| Feature | TAR.GZ (tarball) | TAR.XZ |
|---|---|---|
| Algorithm | DEFLATE | LZMA2 |
| Speed | Fast both ways | Slow to compress |
| Ratio | Baseline | 25-40% smaller |
| Memory at decompress | Tiny | Up to 65 MB |
| Streamable | Yes | Yes |
| Default for kernel.org | No (legacy) | Yes (current) |
About TAR.GZ (tarball)
A tar.gz file (often called a "tarball") is a TAR archive that has been compressed with GZIP. The two-step pipeline preserves Unix permissions and symbolic links from TAR while gaining single-pass DEFLATE compression. Tarballs are the default distribution format for source code on every Unix-like operating system.
Read the full TAR.GZ (tarball) guide →
About TAR.XZ
A tar.xz archive bundles files with TAR and compresses with XZ (LZMA2). It produces the smallest tarballs of the mainstream formats and is now the default for kernel.org, the Linux kernel, and many distribution package payloads.
More comparisons
- ZIP vs RAR
- ZIP vs 7z
- RAR vs 7z
- tar.xz vs tar.zst
- gzip vs Zstandard
- 7-Zip vs WinRAR
- 7-Zip vs PeaZip
- Keka vs The Unarchiver
- ZIP vs tar.gz
- XZ vs Zstandard
- LZ4 vs Snappy
- bzip2 vs bzip3
- ISO vs IMG
- Parquet vs ORC
- VMDK vs qcow2
- APK vs AAB (Android App Bundle)
- CAB vs MSI
- DEB vs RPM
- DMG vs macOS PKG
- Flatpak vs Snap
- AppImage vs Flatpak
- 7z vs ZPAQ
- Borg vs restic
- EPUB vs MOBI