decoder.tools

Bzip2 / LZMA Decoder

Decompress bzip2, LZMA and XZ streams without leaving the browser.

on the roadmapFile Format & Archivesfree · no sign-up

This bench is being wired up

The bzip2-lzma-decoder decoder is on the roadmap. The heavier binary and cryptographic parsers ship after the core text and token decoders — all of which are already live and working.

Browse the live decoders

Input is processed on your device. Nothing you paste is sent anywhere.

What is the Bzip2 / LZMA Decoder?

A bzip2/LZMA decoder decompresses streams produced by the bzip2 and LZMA/XZ algorithms — the two families that trade compression speed for substantially smaller output than DEFLATE.

Bzip2 uses the Burrows-Wheeler transform followed by move-to-front and Huffman coding, working in blocks of up to 900 KB. It compresses better than gzip and decompresses noticeably slower, and its block structure makes it parallelisable — which is why pbzip2 exists.

LZMA and its container XZ went further: a large dictionary, range coding and sophisticated match modelling give the best general-purpose ratios in common use, at the cost of memory and compression time. Decompression is comparatively fast, which is why Linux packages, kernels and source tarballs ship as .xz.

Identification is by magic bytes: 42 5A 68 ('BZh') for bzip2, FD 37 7A 58 5A for XZ, and 5D 00 00 for a raw LZMA alone stream. Getting that identification right is most of the job.

Bzip2 / LZMA Decoder at a glance

Bzip2 magic
42 5A 68 ("BZh") · BWT-based, 900 KB blocks
XZ magic
FD 37 7A 58 5A 00
LZMA alone
5D 00 00 — no container
Trade-off
Smaller than gzip; slower to compress

How to use the Bzip2 / LZMA Decoder

  1. 1Paste the compressed data as base64 or hex.
  2. 2Confirm the format from the detected magic bytes.
  3. 3Read the decompressed output, or download it if it is binary.

When you would reach for it

  • Decompressing a .tar.xz or .bz2 payload found inside another file.
  • Identifying an unknown compressed blob from its header bytes.
  • Extracting an embedded LZMA stream during firmware analysis.

Bzip2 / LZMA Decoder — frequently asked questions

Last reviewed · questions or corrections: contact@decoder.tools