What is an XZ file?

XZ compresses one single file with the LZMA2 method, the same family that 7Z uses. Linux packages and source-code releases use it a lot. To pack a folder, it is first joined into a TAR file (.tar.xz).

Drop your file here

or select file

Images, video, audio, documents, data, archives, fonts and more.

About XZ file:

01XZ at a glance

Full name
xz compressed file
Type
Compresses one single file with LZMA2
Extension
.xz (a compressed TAR: .tar.xz, .txz)
First bytes (hex)
FD 37 7A 58 5A 00
Last bytes (hex)
59 5A (the letters YZ, the footer)
Integrity checks
None, CRC32, CRC64 or SHA-256

02What is an XZ file

XZ is a compression format built on LZMA2, the same method family that 7Z uses. The specification says it is meant to replace the older .lzma format. A file holds one or more streams, and each stream has a header, blocks of data, an index and a footer.

The index lists the size of every block, so a program can find the total unpacked size without unpacking anything. This tool reads it and shows that size. The footer ends with the two letters YZ, and the specification says these footer magic bytes help detect incomplete files quickly, without decompressing. That is how this tool finds a cut-off XZ.

XZ compresses one file. For a folder, tar joins the files first, which gives .tar.xz or .txz. When the first block of a .tar.xz can be read, this tool shows the files from the start of the TAR.

A choice of integrity check is stored in the stream header: none, CRC32, CRC64 or SHA-256. A browser cannot unpack XZ, so this tool checks the structure and the checksums of the header, footer and index, but it does not verify the data inside.

03Good and bad sides

Good

  • LZMA2 compression, the family that 7Z uses
  • Strong integrity checks (up to SHA-256)
  • The footer shows at once if a file is incomplete
  • Common for Linux packages and source releases

Bad

  • Older systems need a program to open it
  • One file only, no password
  • Browsers cannot unpack it

04Best for

  • Linux packages and source releases

    Common for downloads where size matters, as .tar.xz. Strong checks make damage easy to spot.

  • Checking that a download is complete

    The footer shows at once if a file is incomplete.

  • Older systems

    Older systems need a program to open it.

05How to open it

Linux, macOS
Terminal: unxz file.xz, or tar -xJf file.tar.xz
Windows 11
File Explorer opens .tar.xz and .txz since the October 2023 update
Older Windows
7-Zip

06Convert and compare

Related formats: GZ, BZ2, TAR, 7Z

Sources