MIME type lookup (file extension to content type)
A MIME type (media type) such as image/png or application/json tells a browser or client what a file contains, and servers send it in the Content-Type header. Type an extension or a MIME type to see its match and where it is registered.
MIME type for .js
text/javascript
JavaScript, classic scripts and modules · registered with IANA
- MIME type
- text/javascript
- Content-Type header
- Content-Type: text/javascript; charset=utf-8
- Extensions
- .js, .mjs
- What it is
- JavaScript, classic scripts and modules
- IANA registry
- Registered with IANA (reference: RFC 9239)
- Extension listed by
- MDN Common media types
- RFC 9239 makes text/javascript the one type for JavaScript and marks application/javascript, application/ecmascript and text/ecmascript obsolete. It lists .mjs as a JavaScript extension, read as a module. With no charset parameter or byte order mark, scripts are read as UTF-8.
- This page knows 73 common file types, a curated list; IANA's registry has many more.
How does a server choose a file's MIME type?
A MIME type, or media type, is two names separated by a slash: a top-level type such as image, text or application, then a subtype, as in image/png. A server sends it in the Content-Type header, and MDN points out that browsers decide how to handle a response from that header, not from the file extension, so the server has to send the right one.
IANA keeps the official list. RFC 6838 sets the rules: types of general interest go in the standards tree (image/png), product-specific ones in the vendor tree with a vnd. prefix (application/vnd.ms-excel), and the x. tree is for private use and strongly discouraged. Older names that start with x-, such as application/x-tar, were never registered, yet MDN still lists several of them as the usual type for their files.
Two defaults cover what isn't known: MDN says text/plain is the default for textual files and application/octet-stream for everything else, which browsers download rather than display. Text types take a charset parameter, as in text/html; charset=utf-8, while JSON has none, because RFC 8259 requires UTF-8 when JSON is exchanged between systems.
This lookup holds a curated list of 73 common types, not all of IANA's registry. Each was checked against IANA's registry (last updated 2026-10-09) and against MDN's common types table on 2026-10-20; the 9 that are common but not registered with IANA are marked as such.
type/subtype[; parameter=value] image/png text/html; charset=utf-8 application/vnd.openxmlformats-officedocument.wordprocessingml.document unknown binary → application/octet-stream
Which MIME type goes with each file extension?
| Extension | MIME type | What it is | In IANA registry |
|---|---|---|---|
| .png | image/png | PNG image | Yes (W3C (PNG)) |
| .jpg, .jpeg | image/jpeg | JPEG image | Yes (RFC 2045, RFC 2046) |
| .gif | image/gif | GIF image | Yes (RFC 2045, RFC 2046) |
| .webp | image/webp | WebP image | Yes (RFC 9649) |
| .avif | image/avif | AVIF image | Yes (Alliance for Open Media) |
| .apng | image/apng | Animated PNG image | Yes (W3C) |
| .svg | image/svg+xml | SVG vector image | Yes (W3C) |
| .ico | image/vnd.microsoft.icon | Icon file (favicon) | Yes (vendor tree) |
| .bmp | image/bmp | Bitmap image | Yes (RFC 7903) |
| .tif, .tiff | image/tiff | TIFF image | Yes (RFC 3302) |
| .mp3 | audio/mpeg | MP3 audio | Yes (RFC 3003) |
| .m4a | audio/mp4 | MP4 audio | Yes (RFC 4337, RFC 6381) |
| .aac | audio/aac | AAC audio | Yes (ISO/IEC JTC 1) |
| .oga | audio/ogg | Ogg audio | Yes (RFC 5334, RFC 7845) |
| .ogg | audio/ogg | Ogg audio (or video) | Yes (RFC 5334, RFC 7845) |
| .opus | audio/ogg | Opus audio in an Ogg container | Yes (RFC 5334, RFC 7845) |
| .flac | audio/flac | FLAC audio | Yes (RFC 9639) |
| .wav | audio/wav | WAVE audio | No |
| .weba | audio/webm | WebM audio | No |
| .mid, .midi | audio/midi | MIDI | No |
| .mp4 | video/mp4 | MP4 video | Yes (RFC 4337, RFC 6381) |
| .m4v | video/mp4 | MP4 video | Yes (RFC 4337, RFC 6381) |
| .webm | video/webm | WebM video | No |
| .ogv | video/ogg | Ogg video | Yes (RFC 5334, RFC 7845) |
| .mpeg, .mpg | video/mpeg | MPEG video | Yes (RFC 2045, RFC 2046) |
| .mov | video/quicktime | QuickTime video | Yes (RFC 6381) |
| .avi | video/x-msvideo | AVI video | No |
| .ts | video/mp2t | MPEG transport stream | Yes (RFC 3555) |
| .3gp | video/3gpp | 3GPP video container | Yes (RFC 3839, RFC 6381) |
| .3g2 | video/3gpp2 | 3GPP2 video container | Yes (RFC 4393, RFC 6381) |
| .woff | font/woff | WOFF font | Yes (RFC 8081) |
| .woff2 | font/woff2 | WOFF2 font | Yes (RFC 8081) |
| .ttf | font/ttf | TrueType font | Yes (RFC 8081) |
| .otf | font/otf | OpenType font | Yes (RFC 8081) |
| .eot | application/vnd.ms-fontobject | Embedded OpenType font | Yes (vendor tree) |
| application/pdf | PDF document | Yes (RFC 8118) | |
| .txt | text/plain | Plain text | Yes (RFC 2046, RFC 3676, RFC 5147) |
| .csv | text/csv | Comma-separated values | Yes (RFC 4180, RFC 7111) |
| .md | text/markdown | Markdown | Yes (RFC 7763) |
| .rtf | application/rtf | Rich Text Format | Yes (IANA template) |
| .doc | application/msword | Microsoft Word (97–2003) | Yes (IANA template) |
| .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | Microsoft Word | Yes (vendor tree) |
| .xls | application/vnd.ms-excel | Microsoft Excel (97–2003) | Yes (vendor tree) |
| .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Excel | Yes (vendor tree) |
| .ppt | application/vnd.ms-powerpoint | Microsoft PowerPoint (97–2003) | Yes (vendor tree) |
| .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | Microsoft PowerPoint | Yes (vendor tree) |
| .odt | application/vnd.oasis.opendocument.text | OpenDocument text | Yes (OASIS) |
| .ods | application/vnd.oasis.opendocument.spreadsheet | OpenDocument spreadsheet | Yes (OASIS) |
| .odp | application/vnd.oasis.opendocument.presentation | OpenDocument presentation | Yes (OASIS) |
| .epub | application/epub+zip | EPUB e-book | Yes (W3C) |
| .ics | text/calendar | iCalendar | Yes (RFC 5545) |
| .vcf, .vcard | text/vcard | vCard contact | Yes (RFC 6350) |
| .zip | application/zip | ZIP archive | Yes (IANA template) |
| .gz | application/gzip | Gzip archive | Yes (RFC 6713) |
| .tar | application/x-tar | Tape archive (TAR) | No |
| .7z | application/x-7z-compressed | 7-Zip archive | No |
| .rar | application/vnd.rar | RAR archive | Yes (vendor tree) |
| .bz2 | application/x-bzip2 | Bzip2 archive | No |
| .jar | application/java-archive | Java archive (JAR) | Yes (JCP) |
| .zst | application/zstd | Zstandard compressed data | Yes (RFC 8878) |
| .html, .htm | text/html | HTML page | Yes (W3C) |
| .css | text/css | CSS stylesheet | Yes (W3C) |
| .js, .mjs | text/javascript | JavaScript, classic scripts and modules | Yes (RFC 9239) |
| .json | application/json | JSON | Yes (RFC 8259) |
| .jsonld | application/ld+json | JSON-LD | Yes (W3C) |
| .xml | application/xml | XML | Yes (RFC 7303) |
| .xhtml | application/xhtml+xml | XHTML page | Yes (W3C) |
| .wasm | application/wasm | WebAssembly module | Yes (W3C) |
| .webmanifest | application/manifest+json | Web app manifest | Yes (W3C) |
| .atom | application/atom+xml | Atom feed | Yes (RFC 4287, RFC 5023) |
| .yaml, .yml | application/yaml | YAML | Yes (RFC 9512) |
| .sh | application/x-sh | Shell script | No |
| .bin | application/octet-stream | Any binary data | Yes (RFC 2045, RFC 2046) |
How to find a file's MIME type
- 1Type the extension or the typeEnter an extension such as .webp or webp, a file name such as report.pdf, or a MIME type such as image/svg+xml.
- 2Read the matchThe result gives the MIME type, the Content-Type header to send, every extension that maps to it and whether IANA registers it.
- 3Copy the headerCopy the Content-Type line into your server, CDN or upload configuration; text types come with charset=utf-8.
- 4Browse a familyType image, audio, video, font or text, or a word such as excel, to list every matching type in the table.
Frequently asked questions
Should JavaScript be served as text/javascript or application/javascript?
What MIME type should a server send for an unknown file?
Is image/x-icon or image/vnd.microsoft.icon right for a favicon?
Do I need charset=utf-8 in the Content-Type header?
What does the x- prefix in a MIME type mean?
Sources
- IANA, Media Types registry (last updated 2026-10-09; checked per type in the application, audio, font, image, text and video lists) (checked 20 Oct 2026)
- MDN, Common media types (the extension table) (checked 20 Oct 2026)
- MDN, Media types (MIME types): structure, charset default, octet-stream, sniffing (checked 20 Oct 2026)
- MDN, Media container formats (.ogg, .flac, .m4v, .mov, .mpg; WAVE spellings) (checked 20 Oct 2026)
- RFC 6838, Media Type Specifications and Registration Procedures (trees, x- names) (checked 20 Oct 2026)
- RFC 9239, Updates to ECMAScript Media Types (text/javascript, .mjs, obsolete types) (checked 20 Oct 2026)
- RFC 8259, The JSON Data Interchange Format (UTF-8, no charset parameter, .json) (checked 20 Oct 2026)
- RFC 6350, vCard Format Specification (.vcf, .vcard; UTF-8 only) (checked 20 Oct 2026)
- RFC 8878, Zstandard Compression (application/zstd, .zst) (checked 20 Oct 2026)
- RFC 9512, YAML Media Type (application/yaml, .yaml and .yml) (checked 20 Oct 2026)
- RFC 4287, The Atom Syndication Format (application/atom+xml, .atom) (checked 20 Oct 2026)
Need a custom dev tool for your team?
We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.
Built by CountryDevs · No signup · No ads · We count visits, never what you enter