devkult_
tools30converters34
home/mime/.bz2

.bz2 MIME type

Bzip2 filearchives

application/x-bzip2

Bzip2-compressed files, usually .tar.bz2 archives.

MIME typeapplication/x-bzip2
Extensions.bz2
Content-Typeapplication/x-bzip2
Compress in transit?No — already compressed
File signature42 5A 68 (BZh)
followed by a digit 1–9 giving the block size

Good to know

  • Bzip2 compresses better than gzip but slowly; most projects have moved on to xz or zstd.

Serve .bz2 files with the right type

The response header to send:

Content-Type: application/x-bzip2

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
application/x-bzip2 bz2;
Apache (.htaccess or server config)
AddType application/x-bzip2 .bz2
Express
res.set("Content-Type", "application/x-bzip2");
Python
import mimetypes

mimetypes.add_type("application/x-bzip2", ".bz2")
HTML file input
<input type="file" accept=".bz2,application/x-bzip2">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.bz2 | grep -i '^content-type:'
file --mime-type file.bz2

Frequently asked questions

What is the MIME type for .bz2 files?

application/x-bzip2.

What Content-Type header should a .bz2 file be served with?

Content-Type: application/x-bzip2. It's already compressed, so servers shouldn't gzip it.

How can I tell if a file is really a .bz2?

Check its bytes rather than the extension: BZ2 files start with 42 5A 68 (BZh) — followed by a digit 1–9 giving the block size. On the command line, file --mime-type name.bz2 does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options