FILE FORMAT GUIDE

BZ2 File: Decompress Data or Inspect TAR.BZ2

A BZ2 file contains bzip2-compressed data. Decompress it to recover the underlying file. When the name ends in .tar.bz2, decompression produces a TAR archive; its entries still require a separate archive-reading step.

Quick facts

Extension
.bz2
Format
Bzip2 Compressed Data
Category
archive
MIME type
Unknown
Standard / developer
Julian Seward / bzip2
Open with
7-Zip

What is BZ2?

Bzip2 compresses a byte stream using block sorting and Huffman coding. It does not provide a multi-file directory archive by itself. TAR can collect files first, and bzip2 can then compress that TAR as one input stream.

How to open BZ2

Bzip2 decompression and TAR entry extraction are separate tasks.

7-ZipWindows

Open the BZ2 compression layer; if the result is a TAR, inspect that archive separately.

Common uses and compatibility

  • Compress a file for storage or transfer.
  • Read a bzip2-compressed TAR archive with an archive-aware reader.

Things to check

  • A successful compressed integrity check does not explain the purpose of the decompressed file.
  • Compressed data may expand substantially; check output space before decompression.

Advanced inspection

These developer and command-line workflows inspect structure or metadata. They are not the default way most people open the file.

bzip2Command line; bzip2 required

Use --test to check compressed integrity, or --decompress --keep when output is intended.

Technical details

Signature
Unknown
Encoding
Unknown
Container
Bzip2 compressed byte stream; may wrap a TAR archive
Compression
Burrows-Wheeler block sorting and Huffman coding

Public specification: unknown.

Test or decompress while keeping the input

With bzip2 installed, use --test for an integrity check. Use --decompress --keep to recover the output while retaining the BZ2. These are separate operations; do not force an overwrite just to inspect a file.

Choose testing or decompression

bzip2 --test "example.bz2"
bzip2 --decompress --keep "example.bz2"

Sources: bzip2 and libbzip2 manual — sourceware.org

List a TAR.BZ2 without extracting it

For a known .tar.bz2, Python tarfile can list the archive entries directly through the compression layer. Listing does not write those entries to an output directory.

Inspect a known local file

python -m tarfile -l "example.tar.bz2"

Sources: tarfile: bzip2 archive reading — Python

Why did I get a TAR instead of a folder?

The outer BZ2 stream and the inner TAR archive are separate layers. An ordinary .bz2 may contain some other underlying file. Inspect that result with the tool appropriate for its actual format.

Sources: bzip2 and libbzip2 manual — sourceware.org · tarfile: bzip2 archive reading — Python

Related formats

Sources & review

Sources reviewed 2026-11-16.