File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Data
  • Structured text
  • Binary serialisation
  • Databases
  • Scientific
  • Geospatial
  • Machine learning
  • Messages & calendars
  • Compression
  • Archives
  1. Home
  2. Data
  3. Compression
  4. XZ
.XZ
  • Overview

.XZ

XZ compressed file

Introduction

XZ compresses a single file with the LZMA2 method, which usually gives smaller files than gzip or bzip2 at the cost of slower compression. Lasse Collin designed the format, and XZ Utils was released in 2009. Many Linux distributions use it for software packages and source code releases, often as .tar.xz.

Software

  • XZ Utils (macOS, Linux, Windows)
  • 7-Zip (Windows)
  • WinRAR (Windows)
  • PeaZip (Windows, macOS, Linux)

Structure

An XZ file is one or more streams. Each stream is framed by a header and a footer that mirror each other, so a reader can check it from either end.

  1. 0Stream header magic FD 37 7A 58 5A 00, stream flags, CRC-3212 bytes
  2. 12Blocks each a block header, compressed data, padding and a check valuerepeated
  3. …Index the compressed and uncompressed size of every blockvaries
  4. …Stream footer CRC-32, index size, stream flags, magic YZ12 bytes
One XZ stream: header, blocks, index and footer.

The stream flags name the check used on each block’s data: none, CRC-32, CRC-64 or SHA-256. The index lets a reader find any block and jump straight to it, and each block header lists the filters applied, normally LZMA2 and sometimes a filter that makes machine code compress better.

© 2026 fileformats.org About Contact Made by Lewpen