Bzip2 MIME Type
application/x-bzip2 means, how to identify and decompress Bzip2 data, and how Poly handles .bz2 files. MIME type details for application/x-bzip2
In active use| MIME type | application/x-bzip2 |
|---|---|
| Extensions | .bz2.tbz2.tbz |
| Magic number | 42 5A 68 |
| First standardized | 1996 |
| Created by | Julian Seward |
| Browser support | No native browser decompression |
| Example applications | bzip2, 7-Zip, GNU tar |
| Poly support | Partial. Poly recognizes .bz2 as application/x-bzip2 and stores, syncs, shares, and versions the file, but does not decompress it. Compound .tbz2 and .tbz extensions are not recognized as Bzip2. |
| Indexed by Poly | Partial. Poly indexes the Bzip2 file's name and ordinary file properties, but not the compressed data or any tar members. |
| Preview in Poly | No. Poly has no in-app Bzip2 decompressor or archive browser; download the file and open it with a compatible utility. |
| Poly agent | No. The Poly agent cannot read or reason about content inside a Bzip2 stream. |
What does application/x-bzip2 mean?
The application/x-bzip2 media type identifies data compressed with Bzip2, usually in a file ending in .bz2. Bzip2 is lossless: decompression reproduces the original bytes exactly. It applies the Burrows-Wheeler block-sorting transform and Huffman coding to blocks of input data.1
MDN associates .bz2 with application/x-bzip2, but IANA's application registry does not contain this subtype.23 The media type is a widely used, unregistered convention. The x- prefix reflects that history, not a distinct edition of Bzip2.
.bz2 file is a compressed byte stream, not necessarily a multi-file archive. A .tar.bz2, .tbz2, or .tbz file is normally a TAR archive compressed as one Bzip2 stream.Where did Bzip2 come from?
Julian Seward created Bzip2 and first released version 0.15 in July 1996. Version 1.0 followed in 2000.4 The current 1.0.8 manual identifies Seward as the author and describes the program and libbzip2 library.1
Bzip2 replaced Seward's earlier bzip design. The similarly named .bz format is not compatible with Bzip2, and MDN maps it to the separate application/x-bzip media type.24 Renaming an old .bz file to .bz2 does not make it decodable by Bzip2.
How do you identify a Bzip2 file?
A Bzip2 stream starts with the ASCII bytes BZh, or 42 5A 68 in hexadecimal. The next byte is an ASCII digit from 1 through 9 that records a block size from 100,000 through 900,000 bytes.1 A common opening is therefore:
42 5A 68 39 ...
B Z h 9
The 9 means the stream was encoded with 900,000-byte blocks. It is not a format version or compression-quality score. Larger blocks can improve compression, while the decoder's memory requirement is fixed by the block size stored in the stream header.1
Checking BZh is a useful first test, but it is not full validation. Bzip2 stores 32-bit CRC values so a decoder can detect accidental corruption. The command-line program's test operation reads and checks the stream without writing decompressed output:1
bzip2 -tv download.bz2
The CRC is an integrity check, not a cryptographic signature. It does not prove who created the file or whether its decompressed contents are safe.
How do you open an application/x-bzip2 file?
Browsers do not provide a native viewer or decompressor for Bzip2 files. A link served with application/x-bzip2 is normally downloaded and handed to another application.
- The Bzip2 package provides
bunzip2,bzcat, andbzip2 -d. - 7-Zip lists BZIP2 among the formats it can pack and unpack.5
- GNU tar can pass a TAR archive through Bzip2, which is convenient for
.tar.bz2and.tbz2files.6
To preserve the compressed file while writing the decompressed result:
bzip2 -dk report.txt.bz2
For a TAR archive, list its members before extraction:
tar -tjf source.tar.bz2
tar -xjf source.tar.bz2 -C empty-directory
The Bzip2 manual also recognizes .tbz2 and .tbz as TAR-related suffixes and maps them back to .tar during decompression.1 These extensions describe the expected uncompressed payload, whereas .bz2 alone does not reveal whether the result is text, an image, a TAR archive, or another type.
Support in Poly
Poly recognizes the .bz2 extension as application/x-bzip2 and classifies the file as an archive. It can store, sync, share, version, download, and find the file by name.
Poly treats the compressed bytes as opaque:
- It does not decompress the Bzip2 stream or inspect a TAR archive inside it.
- It does not index decompressed text, tar member names, or member metadata.
- It does not generate a thumbnail or offer an in-app preview.
- The Poly agent cannot read or reason about the compressed contents.
The compound .tbz2 and .tbz extensions are conventional Bzip2 TAR archive names, but Poly's current filename mapping recognizes only .bz2 for this MIME type. A file named backup.tar.bz2 still ends in .bz2 and is recognized. A file named only backup.tbz2 or backup.tbz is not classified as Bzip2 from its extension.
Download and decompress the stream with a trusted local tool when you need its contents. Adding the decompressed output to Poly separately allows that file to use the preview and indexing pipeline for its own format.
Bzip2 versus .tar.bz2
The distinction matters when opening or converting a file:
| Filename | What one decompression step normally produces | Contains a member list? |
|---|---|---|
notes.txt.bz2 | notes.txt | No |
backup.tar.bz2 | backup.tar | The resulting TAR archive does |
backup.tbz2 or backup.tbz | A TAR archive | The resulting TAR archive does |
Bzip2 itself compresses each input file into a corresponding stream. It does not store an original filename inside the compressed data. The command-line tool reconstructs output names by removing recognized suffixes.1 Tar supplies the directory tree, filenames, permissions, and other archive structure when multiple files must travel together.
To convert a .tar.bz2 package to ZIP, extract the TAR archive and create a new ZIP archive from the extracted tree. To convert a plain .bz2, first decompress it and then decide whether the resulting single file should be compressed again. Merely changing the extension changes neither the compression algorithm nor the container.
Safety and recovery considerations
Test an unfamiliar stream before trusting it, and place TAR archive output in a new directory. A small compressed file can expand substantially, so set storage, memory, and time limits when processing untrusted input. The official manual notes that Bzip2 uses substantial CPU and memory and has high latency compared with interactive compressors.1
For a TAR archive, inspect paths before extraction. Absolute paths, parent-directory references, symbolic links, and executable members can be dangerous even when the outer Bzip2 stream passes its CRC checks.
Bzip2 data is divided into independently checksummed blocks. The distribution includes bzip2recover, which can search a damaged file for block boundaries and write recoverable blocks to separate files.1 Recovery may still be incomplete, and a recovered tar stream may lack the sections that carried particular files or metadata. Keep another copy of important data rather than relying on repair.
Footnotes
- Julian Seward. bzip2 and libbzip2, version 1.0.8. The official manual documents the algorithm, command behavior, suffixes, header bytes, block sizes, CRC checks, memory use, and recovery tool. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
- MDN Web Docs. Common Media Types. The table maps
.bz2toapplication/x-bzip2and distinguishes.bzasapplication/x-bzip. ↩ ↩2 - Internet Assigned Numbers Authority. Media Types Registry. The current application registry does not list
application/x-bzip2. ↩ - Library of Congress. bzip2 Format Description. The preservation description records the 1996 release history and explains the incompatibility with bzip. ↩ ↩2
- 7-Zip. 7-Zip. The official feature list includes BZIP2 among its packing and unpacking formats. ↩
- Free Software Foundation. GNU tar Manual. The manual documents filtering tar archives through Bzip2. ↩