How to Extract Files from a XZ Archive on macOS
XZ compression uses the LZMA2 algorithm to achieve some of the best compression ratios available. It's widely used in Linux package managers and for distributing large software packages. macOS supports XZ through Terminal.
The default way to open XZ files on macOS
Tool: Terminal (built-in)
$ xz -d file.xzSteps
- For standalone .xz files: xz -d file.xz (decompresses in place).
- For .tar.xz archives: tar xJf archive.tar.xz
- If xz is not installed, get it via Homebrew: brew install xz
Extract individual files from a XZ archive
The default macOS tools extract everything — there's no way to pick individual files. MacPacker lets you browse XZ archive contents, preview files, and extract only what you need — without unpacking the entire archive.
A better way: open XZ files with MacPacker
MacPacker is a free, open-source macOS archive manager that supports XZ and 30+ other formats. Unlike the default tools, MacPacker lets you:
- Browse archive contents like a folder
- Preview files with Quick Look without extracting
- Extract individual files via drag and drop
- Navigate nested archives (archives within archives)
- Enjoy a native SwiftUI interface that feels right at home on macOS
Get MacPacker
v0.15.1 · macOS 14+$ brew install --cask macpackerApp Store updates may lag a few days behind direct downloads due to Apple review.
Frequently asked questions
How do I extract a .xz file on Mac?
Open Terminal and run: xz -d file.xz. For .tar.xz archives: tar xJf archive.tar.xz. Note the capital J flag for xz-compressed tar archives.
Is XZ supported on macOS?
Yes. Recent macOS versions include the xz command. You can also open .xz and .tar.xz files with MacPacker for a visual browsing experience.
Related formats
TAR (tape archive) bundles files without compression. Often combined with GZ, BZ2, or XZ for compressed archives. Natively supported via Terminal on macOS.
Gzip is the most common compression format on Unix/macOS. Usually wraps a TAR archive to create .tar.gz files. Natively supported on macOS.
Bzip2 offers better compression than Gzip at the cost of speed. Common for source code distributions and Linux packages.
7z is an open-source archive format with excellent compression. macOS has no built-in 7z support.