decoder.tools

Bzip2 / LZMA Decoder

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

INPUT

Or drop a file here: .bz2, .xz or .lzma file

OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

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.

Example

Open a .bz2, .xz or .lzma file, or paste its bytes as Base64 or hex, and it is decompressed in your browser.

Format: XZ, LZMA2, 8.0 MB dictionary
Check type: CRC64
Size: 204.5 KB → 1.6 MB (8.2×)

The decompressed data is shown as text when it is text, and offered as a download either way. A .tar.bz2 or .tar.xz gives you the inner .tar, which the archive parser then lists.

What is the Bzip2 / LZMA Decoder?

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.

How to use the Bzip2 / LZMA Decoder

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

When to use 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 at a glance

Bzip2 magic42 5A 68 ("BZh") · BWT-based, 900 KB blocks
XZ magicFD 37 7A 58 5A 00
LZMA alone5D 00 00 — no container
Trade-offSmaller than gzip; slower to compress

Frequently asked questions

Which compresses better, xz or bzip2?

XZ, usually by a clear margin, and it decompresses faster too. Bzip2's remaining advantages are lower memory use and easy parallelisation.

What is the difference between LZMA and XZ?

LZMA is the algorithm; XZ is the modern container around it, adding a magic header, integrity checks and support for multiple filters. A .lzma file is the older raw form.

How do I identify a compressed file?

By its first bytes: BZh is bzip2, FD 37 7A 58 5A is XZ, 1f 8b is gzip, 50 4B is zip and 37 7A BC AF is 7z.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown