Folders

How to open .BZ2 files (bzip2 and XZ archives) on Android, Windows and Linux

What .bz2, .tbz, .tbz2, .xz and .txz files are and how to open and extract bzip2 and XZ archives for free on Android, Windows and Linux, with no terminal.

Cover: Folders' archive viewer on two phones, labelled .BZ2

You’ve downloaded a Wikipedia database dump, a map extract, a Linux kernel release or a Raspberry Pi disk image, and the name ends in .bz2 or .xz. File Explorer may not know what to do with it, and most phones don’t either.

These are compressed files, very often compressed tar archives. Folders opens .bz2, .tbz, .tbz2, .xz and .txz files on Android, Windows and Linux, for free, and shows what’s inside like a folder.

What is a .BZ2 file?

A .bz2 file has been compressed with bzip2, a free compressor written by Julian Seward in the 1990s. It uses a technique called the Burrows–Wheeler transform and usually makes files smaller than gzip does, at the cost of speed.

XZ came later. Made with the XZ Utils tools, it uses LZMA2 compression, from the same family as 7-Zip’s. It usually compresses better still and unpacks faster than bzip2, though creating an .xz file takes longer. Many Linux projects moved to it for their releases.

Both compress a single file. To compress a whole folder, it’s first bundled with tar (see the TAR guide), and the tar file is then compressed:

Extension What it is
.bz2 One file compressed with bzip2: often a .tar, sometimes a single file like pages-articles.xml.bz2
.tbz, .tbz2 Short for .tar.bz2: a bzip2-compressed tar bundle
.xz One file compressed with XZ: a .tar, or a single file like raspios.img.xz
.txz Short for .tar.xz: an XZ-compressed tar bundle

You’ll meet them in Wikipedia’s database dumps (huge .xml.bz2 files), OpenStreetMap extracts (.osm.bz2), Linux kernel and software releases (.tar.xz), disk images for single-board computers (.img.xz) and scientific data.

How to open a .BZ2 file with Folders

  1. Install Folders from the download page and let it see your files.
  2. Go to the download, or search for .bz2 or .xz.
  3. Tap it. A compressed tar opens as a list of its files; a single compressed file shows as one item.

On Android, files from a browser or another app open with Open with → Folders. On Windows and Linux, double-click the file in Folders. On Windows the installer also registers Folders in File Explorer’s Open with menu for all five extensions.

What you can do with it in Folders

  • Straight to the files. A .tar.bz2, .tbz, .tbz2, .tar.xz or .txz opens to the files inside in one step.
  • Single compressed files. A plain .bz2 or .xz shows the one file inside, named without the extension. Tap it to open it if Folders knows the type, or extract it.
  • Summary: how many files, their unpacked size and the compression ratio.
  • Search in archive, Sort and Archive info.
  • Tap any file to open it without extracting the rest.
  • Extract all or Extract selected, with progress and a cancel button, which helps with large dumps.

Neither format has a table of contents, so to list a compressed tar, or to reach a file deep inside one, it has to be decompressed from the beginning. bzip2 in particular is slow to unpack, so a large archive takes a while. Folders creates ZIP files only, not .bz2 or .xz.

Other ways to open .BZ2 files

  • 7-Zip (free, Windows): opens both, in two steps for compressed tar files.
  • Recent versions of Windows 11 open .tar.bz2 and .tar.xz archives in File Explorer.
  • Linux: tar -xjf file.tar.bz2 and tar -xJf file.tar.xz, or bunzip2 and unxz for single files.
  • Disk images: Raspberry Pi Imager and balenaEtcher write an .img.xz straight to a card, no extracting needed.

Problems opening a .BZ2 file?

“The bzip2 data is damaged” or “The XZ data is damaged.” The download is incomplete or corrupted. Download it again and, if the site offers a checksum file, compare it.

There isn’t room to extract it. Compressed text shrinks a lot, so it grows a lot when unpacked: a Wikipedia dump unpacks to several times its compressed size. Check your free space before Extract all, or use a computer with a big drive.

It’s a disk image (.img.xz). You don’t need to extract it at all. Imaging tools write it to the card directly, and an extracted .img isn’t something you’d browse on a phone anyway.

It ends in .zst, .lz or .lzma. These are other compressors, and they aren’t among the types Folders opens. Your Linux command line (zstd -d, lzip -d, unlzma) or another archive tool can handle them.

Questions people ask

Can I open a .bz2 file on Android? Yes. Tap it in Folders to look inside, open a file or extract it.

bz2 vs gz vs xz: which is better? gzip is the fastest and the most widely supported; bzip2 compresses better but is slow; xz usually compresses best and unpacks faster than bzip2. For most people the difference only shows with very large files.

What is a .tbz2 file? The same as a .tar.bz2: a tar bundle compressed with bzip2. Folders opens .tbz and .tbz2 files the same way.

Is an .xz file safe? The file itself is only compressed data. In 2024 a backdoor was found in two releases of the XZ Utils software, which were then withdrawn; that was a problem with a program on some Linux systems, not with .xz files. As with any archive, only run what’s inside if you trust where it came from.

Related guides: TAR and tar.gz files and ZIP, RAR and 7z files. Or browse all 382 file types Folders opens.

Keep reading