MIME types
A MIME type tells the browser how to treat bytes. Get it wrong and a download becomes a page render, a script fails to execute, or a font is rejected. When in doubt, serve application/octet-stream and let the browser download it.
20 entries
Text and markup
| Extension | MIME type | Notes | |
|---|---|---|---|
| .html | text/html | Always add ; charset=utf-8 | |
| .css | text/css | Rejected if served as text/plain | |
| .js | text/javascript | The standard type; application/javascript is obsolete | |
| .json | application/json | No charset parameter is defined — UTF-8 is assumed | |
| .csv | text/csv | ||
| .md | text/markdown | ||
| .xml | application/xml | text/xml is also registered but discouraged | |
| .yaml | application/yaml | Registered in 2024; text/yaml was common before |
Images
| Extension | MIME type | Notes | |
|---|---|---|---|
| .png | image/png | ||
| .jpg | image/jpeg | Not image/jpg — that type does not exist | |
| .svg | image/svg+xml | Can contain scripts; never serve user uploads inline | |
| .webp | image/webp | ||
| .avif | image/avif | ||
| .ico | image/x-icon | image/vnd.microsoft.icon is the registered form |
Fonts, archives and binaries
| Extension | MIME type | Notes | |
|---|---|---|---|
| .woff2 | font/woff2 | ||
| application/pdf | |||
| .zip | application/zip | ||
| .gz | application/gzip | ||
| .wasm | application/wasm | Required exactly for streaming compilation | |
| (any) | application/octet-stream | Unknown bytes. Triggers a download. |
Browsers may sniff content when the type looks wrong. Send X-Content-Type-Options: nosniff to stop them guessing.