The bzip2 and libbzip2 official home page
The master version of this page lives at
and new stuff, mainly executables, will appear there first.
The current stable version of bzip2 is 1.0.2.
What is bzip2?
bzip2 is a freely available, patent free (see below), high-quality data
compressor. It typically compresses files to within 10% to 15% of the best
available techniques (the PPM family of statistical compressors), whilst
being around twice as fast at compression and six times faster at decompression.
Why would I want to use it?
Because it compresses well. So it packs more stuff into your
overfull disk drives, distribution CDs, floppy disks, Zip disks,
backup tapes, ... whatever. And/or it reduces your phone bills,
customer download times, long distance network traffic,
... whatever. Pretty obvious really. Who's arguing? It's not the
world's fastest compressor, but it's still fast enough to be plenty
Because it's open-source (BSD-style license), and, as far as I know,
patent-free. (To the best of my knowledge. I can't afford to do a
full patent search, so I can't guarantee this. Caveat emptor). So
you can use it for whatever you like. Naturally, the source code is
part of the distribution.
Because it supports (limited) recovery from media errors. If you are
trying to restore compressed data from a backup tape or disk, and
that data contains some errors, bzip2 may still be able to
decompress those parts of the file which are undamaged.
Because you already know how to use it. bzip2's command line flags
are similar to those of GNU Gzip, so if you know how to use gzip,
you know how to use bzip2.
Because it's very portable. It should run on any 32 or 64-bit
machine with an ANSI C compiler. The distribution should compile
unmodified on Unix and Win32 systems. Earlier versions have
been ported with little difficulty to a large number of weird and
The code is organised as a library, with a programming interface.
The bzip2 program itself is a client of the library. You can use
the library in your own programs, to directly read and write .bz2 files,
or even just to compress data in memory using the bzip2 algorithms.
Because the documentation tells you how and to what extent I've
tested it, and you can decide for yourself whether or not to entrust
your data to it. For 1.0.0, the test volume is about 6 gigabytes in
circa 120,000 files.
Getting the latest version: bzip2-1.0.2
1.0.2 is a minor maintenance release which fixes some security holes
and various minor problems in 1.0.0/1.0.1. See the CHANGES
file in the sources for details. Upgrading to 1.0.2 is recommended.
Executables for 1.0.2
First off, here are some executables I've collected. I hope to expand
this list over time. Because 1.0.2 is pretty new, this list is very
small. If your system isn't listed, there may be an older version
available: see the next section. As with previous releases, I will
expand this list as people donate executables for other systems.
Please read the notes on executables before
downloading. You might avoid some common problems.
the source code, including full documentation. For the paranoid,
some MD5 sums:
If you can be bothered, please email
me to say you've got a copy. It's nice to know where this
stuff gets to.
version of the complete manual. And here's the
Many people have asked about Y2K issues in bzip2.
Here's a short statement.
David Fetter maintains a
Some notes on executables:
If Netscape tries to display the executable as text rather than
saving it to disk, try cancelling the operation. Instead, do
shift-Click, or right-click on the link to get a menu. Similar
tricks (a right-click?) will probably get you a menu in Internet
Explorer, with which to save the file.
I hope that these executables work correctly and don't do nasty
things, but can't guarantee that, since I have no way to test most
of them. If you're as paranoid as I am, and want to use bzip2
to compress Extremely Important Data, you might want to build it
from the source code. It's really very easy. That way
you get a self-test of the program, which might catch unforseen
nasties on obscure machine/OS combinations.
Unix man page, so you can see properly how to use it.
For full documentation, download the source bundle or see the
Getting an older version
Here's a list of increasingly ancient executables for increasingly
ancient platforms. Try these if you can't get a 1.0.2 executable for
your platform, and you can't build 1.0.2 from source. Be hereby
warned that newer versions are more secure, more featureful and
faster, so it's much preferable to use the latest version (1.0.2).
Please read the notes on executables
before downloading. That said, here's the long list of executables
for old platforms:
Version 1.0.0 (and 1.0.1; these are functionally identical)
The compression library underlying 1.0.0/1.0.1 There's
increasing demand for the library as a DLL (Win32) or as Unix dynamic
shared objects (.so's). Here are some. Linux users, you first need
to find out which libc version you have, by doing 'ls
If your machine isn't listed here, don't despair. bzip2 is very portable.
It should run on practically any 32 or 64 bit computer, if you have enough
spare memory (at least 8 megabytes). If you have an ANSI C compiler,
you have a very good chance of building a working executable from the sources
with minimal difficulty.
Sparc, Solaris 2.5
Sparc, SunOS 4.1
Alpha, Digital Unix 4.0
RS/6000, AIX 3.2.5
PA/RISC, HPUX 10.20
(m68k and PPC)
Click here for the MacBzip2 home page.
TO USE: Rename the file you've got to plain "bzip2" (or
"bzip2.exe", on Win95/98/NT/2000), and use it. Unix folks will also
need to set the permissions suitably ("chmod u+x bzip2").
To decompress a .bz2 file, do "bzip2 -d my_file.bz2". Remember,
the one program does both compression and decompression. To get decompression
by default, copy "bzip2.exe" to "bunzip2.exe" (Win95/98/NT/2000), or symlink
"bzip2" to "bunzip2" (Unix users).
What's your day job?
I'm an (experimental) compiler-writer by trade. At the moment I work
as a research assistant for Glasgow University, helping develop a compiler for the functional
language Haskell. The Glasgow Haskell compiler serves as a
testbed for research into Haskell, and at the same time is a
stable, well regarded, freely available, state of the art optimising
compiler for Haskell. It's available for most major platforms.
Perhaps you'd care to give it a spin. It's open source. Naturally.
In the more distant past, I worked for five years on parallelising compilers
for functional languages at the University
of Manchester, UK. I'm a big fan of Haskell,
an elegant and useful functional language. Getting a bit bored with
C? Try doing some lazy functional programming in Haskell. It'll
change the way you think about programming. Permanently.
I'm a member of the ACM, which I think
is a fine organisation. You can reach me by email
through ACM, or via a more
Other stuff I did: cacheprof
Memory effects have a big effect on the performance of programs --
especially bzip2. I tried and failed to find a decent, open-source
tool which would tell me exactly which lines of code produce cache
misses, and in the end I wrote my own. It's a useful performance
analysis tool, and I think it totally Kicks Ass. Your opinion may
differ. In any case, you can get it from
Julian Seward (email@example.com).
Last updated 26 January 2002.