.xz

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.

Category
Archive
Type
Binary
Is a .xz file safe to open? Safe to extract with a trusted tool. As with any archive, scan the contents before running anything you unpack.

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.

What opens 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.

Windows

  • 7-Zip
  • WinRAR
  • PeaZip

macOS

  • The Unarchiver
  • Keka
  • tar (command line)

Linux

  • xz
  • tar
  • Ark / Nautilus

Open a .xz file step by step

  1. Confirm the file really is a .xz. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with 7-Zip or WinRAR.
  3. On Mac, use The Unarchiver or Keka.
  4. On Linux, try xz or tar.
  5. Still stuck? Convert the .xz to gz, which opens more widely.

Why can't I open my .xz file?

Almost always because no installed app understands XZ. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .xz at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

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.

What is the .xz file signature (magic bytes)?

A .xz file starts with the hex bytes FD 37 7A 58 5A 00, which read as ý7zXZ. in ASCII. Programs identify XZ by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for XZ. For a full breakdown, see the xz file signature page.

Documented magic-byte signatures for the .xz format
Hex signatureOffsetASCIINote
FD 37 7A 58 5A 000ý7zXZ.'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. How sources are ranked and what is deliberately left out is set out in the methodology.