How to Extract XZ Files on Mac

XZ uses the LZMA2 compression algorithm and is the default compression format for many Linux distributions and open source projects. macOS does not include a native XZ extractor in Finder or Archive Utility, making a dedicated tool necessary for decompressing standalone .xz files that Mac users download from Linux software repositories, developer forums, and package archives. UnFox is a free unarchiver for Mac that extracts XZ compressed files through a native graphical interface.

What Is an XZ File and Where Is It Used?

XZ is a compression format built on the LZMA2 algorithm that delivers the highest compression ratios among commonly used Unix compression tools. Most Linux distributions use XZ for package distribution because it produces significantly smaller archives than gzip, reducing download sizes and mirror storage requirements across thousands of packages. The .xz extension indicates a single compressed file, while .tar.xz indicates a TAR archive compressed with XZ. macOS Archive Utility does not support the XZ format, and double clicking an .xz file produces an error dialog with no option to decompress. The xz command line tool is available on macOS through Xcode command line tools or Homebrew, but for users who prefer a graphical workflow, UnFox includes liblzma to handle XZ decompression natively on both Intel and Apple Silicon without any Terminal interaction.

How Do You Extract an XZ File on Mac?

Drag the .xz file onto UnFox or open it from the File menu. UnFox reads the XZ stream header, decompresses the LZMA2 data, and writes the output file to your chosen destination. For TAR.XZ archives, UnFox handles both layers automatically: it decompresses the XZ container first, then extracts the TAR archive contents into a full directory tree.

Tip

For TAR.XZ archives, UnFox handles both decompression and extraction in one step. No need to decompress first.

Progress tracking runs throughout the entire operation, showing decompression speed and estimated time remaining. XZ decompression uses more CPU time than gzip but produces smaller files, so the tradeoff is worthwhile for bandwidth constrained downloads. You can download UnFox free and start decompressing XZ files without any Terminal setup or Homebrew configuration.

XZ vs BZ2 vs GZ: Choosing the Right Compression Format

XZ achieves the smallest file sizes among the three most common Unix compression formats by a significant margin. A typical software source archive compressed with XZ is 20 to 30 percent smaller than the gzip version and 5 to 15 percent smaller than the bzip2 version. The tradeoff is compression speed: XZ takes significantly longer to compress data than gzip, though decompression speed is comparable on modern hardware because LZMA2 was specifically optimized for fast decoding. BZ2 sits in the middle for both compression ratio and processing speed, though it has fallen out of favor as XZ has become the new default. For Mac users, the choice of format is usually made by the software publisher rather than the end user, and UnFox handles all three transparently without any configuration changes. Users who also encounter standalone bzip2 files can extract BZ2 files on Mac with the same drag and drop approach.

Standalone XZ Files vs TAR.XZ Archives

Note

Standalone .xz files contain exactly one file. If you need multiple files, look for the .tar.xz compound format instead.

XZ is a single file compression format, meaning each .xz file contains exactly one compressed file. Decompressing a standalone .xz file produces the original uncompressed file with the .xz extension removed (for example, database.sql.xz becomes database.sql). When multiple files need to be distributed together, they are first bundled into a TAR archive and then compressed with XZ, creating a .tar.xz file that contains a complete directory structure. This compound TAR.XZ format is far more common than standalone .xz files in practice because software distributions almost always include multiple files, directories, and metadata. UnFox detects whether a file is a standalone XZ or a TAR.XZ archive automatically based on the internal file structure and handles both cases appropriately. For users working specifically with TAR.XZ archives from Linux distributions or kernel.org, the guide on how to extract TAR.XZ files on Mac covers that workflow in detail, including common sources, extraction troubleshooting, and compression ratio comparisons.

XZ and LZMA: Understanding the Relationship

XZ and LZMA are closely related compression technologies that Mac users sometimes confuse. LZMA (Lempel Ziv Markov chain Algorithm) is the original compression algorithm created by Igor Pavlov for the 7-Zip archiver. XZ is a newer container format that wraps LZMA2, an improved version of the original algorithm with better multi threaded support and recovery from corrupted data. Standalone .lzma files use the older format and appear less frequently than .xz files in modern software distribution. Mac users who encounter legacy LZMA compressed data can extract LZMA files on Mac through UnFox, which supports both the older LZMA format and the modern XZ container. The practical difference between the two is minimal for end users: both produce similarly sized output and decompress at comparable speeds. XZ is preferred for new projects because the container format includes integrity checksums, supports better error detection, and aligns with the conventions of modern Linux package management. UnFox supports all 37 archive and compression formats, covering both XZ and LZMA alongside every other compression algorithm used in open source software.

XZ Compression in Linux Package Management

XZ is deeply embedded in the Linux package management ecosystem that Mac developers interact with when managing servers, building cross platform software, or contributing to open source projects. Debian and Ubuntu .deb packages use XZ compressed data archives by default for the main package payload, with the dpkg tool decompressing the XZ data during installation. Arch Linux packages relied heavily on XZ compression for years before the distribution began transitioning to Zstandard for faster package installation. Fedora and Red Hat RPM packages also support XZ compressed payloads, and many RPM based distributions default to XZ compression for their package repositories to minimize mirror bandwidth and storage costs. Mac developers who cross compile software for Linux, maintain Linux server infrastructure through SSH, or contribute to open source projects with Linux CI/CD pipelines encounter these XZ compressed packages regularly. Extracting a Linux package on Mac to review its contents, verify file installation locations, or inspect default configuration values is a common workflow for DevOps engineers working from macOS. UnFox makes this possible without setting up a Linux virtual machine, Docker container, or SSH session, providing direct access to package contents through simple drag and drop extraction on the Mac desktop.
Marcel Iseli
Marcel Iseli

Creator of UnFox ยท Indie Developer

LinkedIn โ†—

Marcel Iseli is an indie developer and the creator of UnFox. He builds native macOS and iOS utilities focused on privacy, simplicity, and zero tracking. Based in Switzerland, every app he ships is a one time purchase with no subscriptions and no data collection.

Frequently Asked Questions

Linux distributions use XZ because LZMA2 compression produces smaller downloads than gzip, reducing bandwidth costs and download times. UnFox lets Mac users extract these XZ archives without Terminal commands.
XZ is a container format that uses the LZMA2 algorithm internally. LZMA is the older standalone format. UnFox handles both XZ and standalone LZMA files.