XZ
Also known as: .xz file, unxz, how to open xz, tar.xz
XZ is a single-file compressor that uses LZMA2 to reach a very high compression ratio — typically the smallest of the common Unix formats. It pairs with TAR as tar.xz and is widely used for software releases and Linux packages.
- LZMA2 — very high compression ratio
- Single-file; pairs with TAR as tar.xz
- Slower to pack than gzip, smaller result
Very high ratio with LZMA2
XZ uses the same LZMA2 engine behind 7z, so it usually produces smaller files than gzip or bzip2. That makes it the go-to for distributing source code, kernels, and Linux packages where a smaller download is worth extra packing time.
Like gzip and bzip2, XZ compresses one file at a time, so folders are bundled first as .tar.xz (sometimes .txz). High ratios cost more CPU and memory, especially when compressing.
Opening and the storage angle
Extract with `unxz file.xz` or `tar -xf file.tar.xz` on Mac/Linux, or 7-Zip/Keka on desktop. Best gains are on text-like data; pre-compressed media (JPEG, MP4, MP3) stays roughly the same size in any archive.
For long-term storage of large text or code folders, tar.xz is one of the most space-efficient options. Delete the .xz after extracting and verifying so you are not holding both copies.