The .xz file format

The .xz file format is a container format for compressed streams. There are no archiving capabilities, that is, the .xz format can hold only a single file just like the .gz and .bz2 file formats used by gzip and bzip2, respectively.

Compared to a few other popular stream compression formats, the .xz format provides a few advanced features. At the same time, it has been kept simple enough to be usable in many embedded systems.


Once a new filter or integrity check has been added to the .xz file format specification, it won't be removed. This ensures that all .xz files that use only the filters defined in the .xz file format specification can always be decompressed in future.

New filters, integrity checks, or other additions to the .xz file format are unlikely to occur very often. New filters are only added to the official list when they are clearly useful.

Currently, the only compression algorithm supported by the .xz file format is LZMA2. The other existing filters do not change the size of the data, but instead can increase the redundency of the stream. LZMA2 is a container format that improves upon LZMA in the following ways:

The official .xz file format specification

The latest version of the official .xz file format specification is available in plain text form here.

Specific versions of the specification:

1.2.0 (2024-01-19)
1.1.0 (2022-12-11)
1.0.4 (2009-08-27)
1.0.3 (2009-06-05)
1.0.2 (2009-06-04)
1.0.1 (2009-06-01)
1.0.0 (2009-01-14)


At least the following software supports the .xz file format:

  • XZ Utils
  • XZ Embedded
  • XZ for Java
  • 7-Zip and LZMA SDK versions 9.00 alpha and later