BZ2 file format: what it is and how to use it
bzip2 compresses single streams with the Burrows-Wheeler transform: smaller than gzip, slower, and the longtime Unix high-ratio choice. Learn when to use it and what to choose instead.
Files stay on your device
-
No uploadsFiles stay on your device
-
Batch processingHandle multiple files at once
-
100% privateNo sign-up, no tracking
What is a BZ2 file?
A .bz2 file is a stream compressed with bzip2, Julian Seward's 1996 compressor built on the Burrows-Wheeler block-sorting transform, reordering data so similar bytes cluster, then run-length and Huffman coding finish the job. It beats gzip's ratio by a clear margin and loses badly on speed, especially decompression. Like gzip it compresses one stream only, which is why .tar.bz2 exists for file sets.
When should you use .bz2?
- Better ratio than gzip in old pipelines: plenty of Unix packaging and archives still ship .bz2.
- Reading existing archives: source tarballs and datasets from the 2000s often live in it.
- CPU-rich, size-poor transfers: when bytes cost more than time.
When is another format a better fit?
For nearly every new use zstd is better, offering comparable or better ratios at many times the speed. gzip stays the compatibility floor; xz/LZMA wins on pure ratio when time is free. bzip2's niche is maintenance of what already exists.
The short version: BZ2 was the Unix high-ratio option before xz and zstd. It is fine to read, but rarely the right new choice.
How to open a BZ2 file
On Windows
Double-click the file, or open it with 7-Zip.
On macOS
PeaZip opens BZ2 files on macOS.
In your browser
Open BZ2 files right in a browser tab or with the dexrr viewer. No install, no upload.
Also opens in
-
7-Zip
-
WinRAR
-
PeaZip -
tar (Unix)
View BZ2 files
A quick preview or a new format. No install, no upload.
BZ2 technical details
- Full name
- bzip2 compressed file
- Extensions
- .bz2 .bzip2
- MIME type
-
application/x-bzip2, application/x-bzip - Magic bytes
-
42 5A 68 (BZh) - Compression
- Lossless
- Developer
- Julian Seward
- Specification
- sourceware.org
BZ2 questions, answered
How do I open a .bz2 file?
bunzip2, tar -xjf, 7-Zip and most archive tools decompress it. dexrr extracts .bz2 files directly in your browser.
Can I convert BZ2 files online?
Yes, dexrr decompresses .bz2 and can repack the contents locally in your browser to zst, gz or zip.
Is BZ2 better than GZIP?
On ratio, yes, typically 10–15% smaller. On speed, no, gzip compresses and decompresses much faster. zstd now beats both.
What is a .tar.bz2 file?
A tar archive (the file bundle) compressed as a whole by bzip2, two formats cooperating: tar bundles, bzip2 shrinks.
Is the BZ2 format outdated?
Largely, since xz and zstd displaced it for new work, though it persists in older source archives and system packages.