← All comparisons

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.

Bottom line: tar.gz for speed and ubiquity. tar.xz for distribution where size matters most.

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.

Read the full TAR.XZ guide →

More comparisons