.xz, .bz2 and .zst are compression formats, like .gz. Each holds a single compressed file, and very often that file is a TAR archive, giving names like project-2.4.tar.xz or backup.tar.zst. Windows and macOS don't always open them with a double-click, but they are easy to decompress once you know what you have.
What these formats are
| Extension | Format | Where you see it | In short |
|---|---|---|---|
.xz, .txz | XZ (LZMA2) | Source code releases, Linux packages | Small files; slower to compress, reasonably fast to decompress. |
.bz2, .tbz2 | BZIP2 | Older source releases, large data dumps | Compresses text better than GZIP, but slowly; mostly replaced by XZ and Zstandard. |
.zst, .tzst | Zstandard | Linux packages, backups, database and log tools | Fast to compress and decompress, with good ratios. |
.lzma, .tlz | LZMA | Older releases | The predecessor of XZ, without its integrity checks. |
.gz, .tgz | GZIP | Everywhere: logs, web servers, source code | The fastest and most widely supported, with larger files. |
None of these is an archive on its own: each compresses exactly one file. To pack a folder, Unix tools first bundle it into a TAR, then compress the TAR. That is why you see two extensions, and why decompressing project.tar.xz gives you project.tar, not a folder. The short forms .txz, .tbz2, .tzst, .tlz and .tgz mean the same as .tar.xz, .tar.bz2, .tar.zst, .tar.lzma and .tar.gz.
Where you'll meet them
- Source code releases, often published as
.tar.xzor.tar.gz, and sometimes.tar.bz2. - Linux packages: Arch Linux packages end in
.pkg.tar.zst, and Debian and Ubuntu.debpackages contain XZ- or Zstandard-compressed TARs inside. - Database dumps and data exports, such as
dump.sql.xz,pages-articles.xml.bz2orevents.json.zst. - Backups and logs, where Zstandard and XZ keep large files small.
Open them in your browser
XZ, BZ2 & ZST Extractor decompresses a single .xz, .bz2, .zst, .lzma or .gz file in your browser, with nothing to install. The format is detected from the file's bytes, so a misnamed file still works. XZ check values and BZIP2 CRCs are verified as it decompresses; Zstandard checksums are not.
If the file is a compressed TAR, open it directly with Extract TAR to browse the folders and download what you need, or convert it for people who prefer ZIP with TAR to ZIP.
Not supported in the browser: XZ files that use BCJ filters, Zstandard files made with a dictionary, and files that need a decompression window over 1 GB. Use the command-line tools below for those.
Open them on Windows
7-Zip opens .xz, .bz2 and .lzma, and recent versions also open .zst. As with .tar.gz, it treats a compressed TAR as two layers: extract once to get the .tar, then again to get the files. Recent versions of Windows 11 can also open several of these formats in File Explorer, mainly when they contain a TAR.
Open them on macOS and Linux
In the Terminal, tar detects the compression itself when extracting compressed TARs:
tar -xf project.tar.xz
tar -xf data.tar.bz2
tar -xf backup.tar.zstFor single compressed files, use the matching tool. -k keeps the compressed file; zstd keeps it by default.
xz -dk dump.sql.xz
bzip2 -dk pages-articles.xml.bz2
zstd -d events.json.zstMost Linux distributions include xz and bzip2; zstd may need to be installed from the package manager. On macOS, bzip2 is built in, and xz and zstd can be installed with Homebrew. If tar can't handle .tar.zst on your system, install zstd first.