An xz file has a stream header (magic FD 37 7A 58 5A 00, flags, CRC-32), one or more blocks each with a block header, a filter chain (LZMA2 with optional BCJ and Delta filters), padding and a check (CRC-32, CRC-64, SHA-256), followed by an index and a stream footer (magic YZ).
Where it is used
Linux package archives and kernel source tarballs.
Compressed backups.
History
Developed by Lasse Collin from 2009 as the successor to the LZMA-alone format.
Status today
Widely used; actively maintained in XZ Utils.
Structures read by the implementation
Offsets are in bytes from the start of the buffer named in each heading. Field names are taken from the implementation and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.
Structures and constants were extracted from: Carving/Plugins/Compressed/XzCarver.cs, IO/Compression/XzDecoder.cs, Modules/FileSystems/XzArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.