Create TAR.BZ2 File

Create a TAR.BZ2 file online: pack files and folders into a bzip2-compressed tar archive in your browser. Free, private, nothing is uploaded.

Files are processed in your browser and never uploaded.

How to create a TAR.BZ2 file

  1. Click Choose files or drag files onto the drop zone above. To pack a directory, click Add a folder or drop the folder itself; subfolders keep their place.
  2. Fill in Archive name. Leaving the default archive gives you archive.tar.bz2.
  3. Click Create TAR.BZ2. A tar archive is built first and then compressed with bzip2.
  4. Use the Download button to save the result.

The bzip2 step runs in libarchive compiled to WebAssembly, inside your browser tab, so your files are never uploaded.

How bzip2 compresses

bzip2 was released by Julian Seward in 1996 and takes a different approach from gzip. Instead of hunting for repeated byte strings, it splits the input into blocks of up to 900 KB and applies the Burrows-Wheeler transform, which reorders the bytes so that similar contexts end up next to each other. The reordered data is then easy to squeeze with move-to-front and Huffman coding. On text, logs and source code this usually beats gzip by a useful margin.

The cost is time. bzip2 is slower than gzip both when compressing and when decompressing. Later, xz arrived and generally produces even smaller files while decompressing faster than bzip2, so many projects moved from .tar.bz2 to .tar.xz. bzip2 is still widely used and supported, and some build scripts, package repositories and older systems expect it specifically.

FormatCompression speedTypical sizeDecompression speed
TAR.GZFastLargest of the threeFast
TAR.BZ2SlowSmallerSlowest
TAR.XZSlowestUsually smallestFast

Exact results depend heavily on the data. Already-compressed files such as JPEG, MP4 or ZIP shrink very little with any of them.

Names, dates and the command line

The archive is POSIX pax tar, so long paths and Unicode file names are kept, and every file retains its original modification date. Empty folders are not stored. The short extension for this format is .tbz2 (sometimes .tbz); it is the same file, and you can rename it if a system insists on that spelling.

To create the same archive yourself, run tar -cjf archive.tar.bz2 folder/. To unpack, use tar -xjf archive.tar.bz2. The j switch is what selects bzip2. Both commands work on Linux and macOS, and Windows 10 and 11 ship a tar command too.

Tips

  • Not sure the recipient's tools handle bzip2? Create TAR.GZ is the most compatible tarball.
  • For the smallest download, try Create TAR.XZ with the same files and compare.
  • To unpack a .tar.bz2 in the browser, use Extract TAR.
  • Need a different target format later? Archive Converter can repack it.

Frequently asked questions

Can I compress a single file to .bz2 without tar?

Yes. The GZIP Compressor has a BZIP2 (.bz2) format option that compresses each file on its own.

Can I choose the bzip2 block size or level?

No. The only option is the archive name; compression settings are fixed.

How large can the archive be?

Everything is held in browser memory. Totals over about 700 MB take a long time with bzip2, and over 2 GB is refused.

Copied to clipboard