.bin MIME type
Binary dataapps & binaries
application/octet-streamArbitrary binary data — the fallback type for anything without a more specific one.
| MIME type | application/octet-stream |
|---|---|
| Extensions | .bin |
| Content-Type | application/octet-stream |
| Compress in transit? | No — already compressed |
Good to know
- Browsers download
application/octet-streamresponses instead of displaying them. - Many servers use it as the default for unknown extensions; nginx's
default_typesets it. - Under
nosniff, a script or stylesheet served asapplication/octet-streamis blocked.
Serve .bin files with the right type
The response header to send:
Content-Type: application/octet-stream
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/octet-stream bin;
Apache (.htaccess or server config)
AddType application/octet-stream .bin
Express
res.set("Content-Type", "application/octet-stream");Python
import mimetypes
mimetypes.add_type("application/octet-stream", ".bin")HTML file input
<input type="file" accept=".bin,application/octet-stream">
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.bin | grep -i '^content-type:' file --mime-type file.bin
Frequently asked questions
What is the MIME type for .bin files?
application/octet-stream.
What Content-Type header should a .bin file be served with?
Content-Type: application/octet-stream. It's already compressed, so servers shouldn't gzip it.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options