BZ2

What is a BZ2 file?

Compresses better than GZ and takes noticeably longer doing it.

What BZ2 is

BZ2 is a stream format, written and read from front to back. It is used for archiving.

The extension is .bz2, and the full name is Bzip2 Archive. Both matter less than what the file can hold, which is what the rest of this page is about.

Where BZ2 came from

It dates from 1996.

A format that has been readable for that long is a format worth trusting with something you want back in ten years.

The specification is public

Anyone can implement it without asking permission or paying a licence, which is why it turns up in so many programs and why files written twenty years ago still open.

It is a legacy format

It still opens everywhere and is still written by older tools, but nothing new is being built around it. Convert what you mean to keep, and do not choose it for something starting today.

Nothing is thrown away

BZ2 stores its content exactly. Saving it again changes nothing, so it can be opened, edited and re-saved as often as you like without accumulating damage — which is what makes it a working format rather than a delivery one.

It holds exactly one file

BZ2 compresses a single stream and has no concept of a filename or a folder. That is why it is so often seen paired with TAR, which supplies the structure it lacks.

Where its compression ratio comes from

It works with a window of 900 KB: the amount of already-seen data it can refer back to when it meets a repeat.

That single number explains most of the difference between one archive format and another. A larger window finds more repetition and takes longer and more memory to do it, which is the whole trade.

What it does to protect itself

BZ2 carries a checksum, so a damaged file is detected rather than silently mis-read.

A checksum will not repair anything. It tells you the file is wrong, which is the difference between finding out now and finding out from whoever you sent it to.

What opens BZ2

bzip2, 7-Zip and Keka read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

It is a delivery format

BZ2 is meant to be handed over rather than worked in. Editing one is possible and rarely pleasant; the sane approach is to change the source and export again.

What goes wrong with it

The recurring complaints: it holds one stream and cannot describe a folder.

None of these is a reason to avoid the format. They are the things worth knowing before you are surprised by one, which is a different claim and a more useful one.

The facts, in one place

Identifiers and provenance for the BZ2 format.
Extension.bz2
Media typeapplication/x-bzip2
First published1996

Converting BZ2 to something else

Converting something else to BZ2

Formats worth considering instead of BZ2