This is a searchable reference that maps common file extensions to the correct MIME type (Content-Type). It is for web developers and server admins who need the exact header value for a given file format.
How it works
A MIME type (media type) is a label like image/png or application/json in the form type/subtype. Servers send it in the Content-Type header so browsers and clients know how to handle the response — render it, play it, or download it. The reference lists each extension with its registered type and a short description, plus a one-click copy button. Type in the search box to filter by extension, type or description.
Quick reference table
| Extension | MIME type | Typical use |
|---|---|---|
.json | application/json | REST API responses, config files |
.png | image/png | Lossless images, logos, screenshots |
.pdf | application/pdf | Documents; browser opens in viewer |
.woff2 | font/woff2 | Modern web fonts; smaller than WOFF |
.mp4 | video/mp4 | H.264 video; widely supported |
.svg | image/svg+xml | Scalable vector art; can embed script |
.webp | image/webp | Efficient raster for photos |
.js | text/javascript | Scripts and ES modules |
.csv | text/csv | Spreadsheet exports |
| (unknown binary) | application/octet-stream | Forces download, no inline render |
When to use application/octet-stream
This is the “I don’t know what this is” type. Sending it tells the browser to download the file rather than try to render or execute it. It is the correct fallback for:
- Binary formats without a registered IANA type
- Files you always want downloaded, not displayed (even PDFs when forced download is needed)
- Proprietary file formats
Pair it with Content-Disposition: attachment; filename="file.bin" to suggest a filename.
Worked example — serving a JSON API
A common mistake is returning JSON without a declared type:
HTTP/1.1 200 OK
Content-Type: text/plain
{"status": "ok"}
This can break fetch() calls in strict environments and confuse API clients. The correct response header is:
Content-Type: application/json; charset=utf-8
The ; charset=utf-8 suffix is optional for JSON (RFC 8259 mandates UTF-8 anyway) but is good practice for any text/* type.
A note on text/javascript vs application/javascript
The IANA registry marks application/javascript as obsolete. Always use text/javascript for .js and .mjs files. HTML spec-compliant browsers require text/javascript for ES modules loaded with <script type="module">.
Setting Content-Type in common server environments
Nginx — add or check your mime.types include file:
types {
text/javascript js mjs;
image/webp webp;
font/woff2 woff2;
}
Apache / .htaccess:
AddType text/javascript .js .mjs
AddType image/webp .webp
AddType font/woff2 .woff2
Node.js / Express:
res.setHeader('Content-Type', 'application/json; charset=utf-8');
// or using the shorthand:
res.type('json');
Vercel / Netlify _headers file:
/assets/*.woff2
Content-Type: font/woff2
Missing or wrong MIME types are one of the most common silent failures in web deployments. If a font is not loading, a script is blocked, or a file is downloading instead of rendering, the Content-Type header is the first thing to check in your browser’s network panel.
Everything runs in your browser; nothing is uploaded.