What is a .xz file?
XZ Compressed File · Archive · Tukaani Project · 2009
XZ is a compression format that usually achieves smaller files than gzip or bzip2, using the LZMA2 algorithm. It is common on Linux for source tarballs and packages, often seen as .tar.xz.
What is a .xz file used for?
An .xz file starts with the six magic bytes FD 37 7A 58 5A 00. It compresses a single stream, so it is normally paired with tar to bundle many files, giving .tar.xz.
XZ trades slower compression for excellent ratios, which is why Linux distributions use it for downloads. Extract it with any modern archive tool.
How to open a .xz file
The .xz format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .xz file.
Windows
- 7-Zip
- WinRAR
- PeaZip
macOS
- The Unarchiver
- Keka
- tar (command line)
Linux
- xz
- tar
- Ark / Nautilus
How to convert a .xz file
You can convert a .xz file to gz, zip, 7z using a conversion tool or the export menu of an app that opens it.
.xz file signature (magic bytes)
Programs recognise a .xz file by the bytes at the start of the file, not by its name. These are the signatures for XZ. For a full breakdown, see the XZ file signature page.
| Hex signature | Offset | Note |
|---|---|---|
| FD 37 7A 58 5A 00 | 0 | '7zXZ' with guard bytes |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .xz file?
XZ is a compression format that usually achieves smaller files than gzip or bzip2, using the LZMA2 algorithm. It is common on Linux for source tarballs and packages, often seen as .tar.xz.
How do I open an .xz file?
Use 7-Zip on Windows, Keka on Mac, or the xz and tar commands on Linux. A .tar.xz needs two steps, or one command: tar -xf file.tar.xz.
Is XZ better than gzip?
Usually XZ makes smaller files, at the cost of slower compression. gzip is faster; XZ wins on ratio, which is why big downloads use it.
What is a .tar.xz file?
A tar archive (many files bundled) compressed with XZ. Extract it in one step: tar -xf file.tar.xz.
Related formats
Sources
Details on this page were checked against authoritative references: