Common MIME types
Servers and upload forms rely on these strings; a wrong type can break previews, downloads, or your Content Security Policy.
| Kind | MIME type | Typical ext |
|---|---|---|
| HTML | text/html | .html |
| CSS | text/css | .css |
| JavaScript | text/javascript | .js |
| JSON | application/json | .json |
| XML | application/xml | .xml |
| Plain text | text/plain | .txt |
| CSV | text/csv | .csv |
| application/pdf | ||
| ZIP | application/zip | .zip |
| PNG | image/png | .png |
| JPEG | image/jpeg | .jpg |
| GIF | image/gif | .gif |
| WebP | image/webp | .webp |
| SVG | image/svg+xml | .svg |
| ICO | image/x-icon | .ico |
| MP3 | audio/mpeg | .mp3 |
| WAV | audio/wav | .wav |
| MP4 | video/mp4 | .mp4 |
| WebM | video/webm | .webm |
| WOFF2 | font/woff2 | .woff2 |
| Form URL-encoded | application/x-www-form-urlencoded | — |
| Multipart form | multipart/form-data | — |
Notes
- Some browsers sniff content; still send the correct type from your server.
- Official JS type is text/javascript (application/javascript is obsolete).
Frequently asked questions
- What MIME type should I use for a .json file?
- Use application/json for JSON files and API responses. It is the standard type and should be served with charset UTF-8 where possible.
- What is the MIME type for .js files?
- The official type for JavaScript is text/javascript. The older application/javascript is obsolete and should no longer be used.
- What MIME type does an SVG image use?
- SVG files use image/svg+xml. Make sure you serve them as SVG, not as image/xml, or browsers will not render them inline.