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.

Type an extension (with or without the dot), a file name, a MIME type, or a word such as “font” or “excel”.

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?

The 73 common types in this curated list, with whether IANA registers each one (checked 2026-10-20); IANA's registry holds many more
ExtensionMIME typeWhat it isIn IANA registry
.pngimage/pngPNG imageYes (W3C (PNG))
.jpg, .jpegimage/jpegJPEG imageYes (RFC 2045, RFC 2046)
.gifimage/gifGIF imageYes (RFC 2045, RFC 2046)
.webpimage/webpWebP imageYes (RFC 9649)
.avifimage/avifAVIF imageYes (Alliance for Open Media)
.apngimage/apngAnimated PNG imageYes (W3C)
.svgimage/svg+xmlSVG vector imageYes (W3C)
.icoimage/vnd.microsoft.iconIcon file (favicon)Yes (vendor tree)
.bmpimage/bmpBitmap imageYes (RFC 7903)
.tif, .tiffimage/tiffTIFF imageYes (RFC 3302)
.mp3audio/mpegMP3 audioYes (RFC 3003)
.m4aaudio/mp4MP4 audioYes (RFC 4337, RFC 6381)
.aacaudio/aacAAC audioYes (ISO/IEC JTC 1)
.ogaaudio/oggOgg audioYes (RFC 5334, RFC 7845)
.oggaudio/oggOgg audio (or video)Yes (RFC 5334, RFC 7845)
.opusaudio/oggOpus audio in an Ogg containerYes (RFC 5334, RFC 7845)
.flacaudio/flacFLAC audioYes (RFC 9639)
.wavaudio/wavWAVE audioNo
.webaaudio/webmWebM audioNo
.mid, .midiaudio/midiMIDINo
.mp4video/mp4MP4 videoYes (RFC 4337, RFC 6381)
.m4vvideo/mp4MP4 videoYes (RFC 4337, RFC 6381)
.webmvideo/webmWebM videoNo
.ogvvideo/oggOgg videoYes (RFC 5334, RFC 7845)
.mpeg, .mpgvideo/mpegMPEG videoYes (RFC 2045, RFC 2046)
.movvideo/quicktimeQuickTime videoYes (RFC 6381)
.avivideo/x-msvideoAVI videoNo
.tsvideo/mp2tMPEG transport streamYes (RFC 3555)
.3gpvideo/3gpp3GPP video containerYes (RFC 3839, RFC 6381)
.3g2video/3gpp23GPP2 video containerYes (RFC 4393, RFC 6381)
.wofffont/woffWOFF fontYes (RFC 8081)
.woff2font/woff2WOFF2 fontYes (RFC 8081)
.ttffont/ttfTrueType fontYes (RFC 8081)
.otffont/otfOpenType fontYes (RFC 8081)
.eotapplication/vnd.ms-fontobjectEmbedded OpenType fontYes (vendor tree)
.pdfapplication/pdfPDF documentYes (RFC 8118)
.txttext/plainPlain textYes (RFC 2046, RFC 3676, RFC 5147)
.csvtext/csvComma-separated valuesYes (RFC 4180, RFC 7111)
.mdtext/markdownMarkdownYes (RFC 7763)
.rtfapplication/rtfRich Text FormatYes (IANA template)
.docapplication/mswordMicrosoft Word (97–2003)Yes (IANA template)
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentMicrosoft WordYes (vendor tree)
.xlsapplication/vnd.ms-excelMicrosoft Excel (97–2003)Yes (vendor tree)
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetMicrosoft ExcelYes (vendor tree)
.pptapplication/vnd.ms-powerpointMicrosoft PowerPoint (97–2003)Yes (vendor tree)
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationMicrosoft PowerPointYes (vendor tree)
.odtapplication/vnd.oasis.opendocument.textOpenDocument textYes (OASIS)
.odsapplication/vnd.oasis.opendocument.spreadsheetOpenDocument spreadsheetYes (OASIS)
.odpapplication/vnd.oasis.opendocument.presentationOpenDocument presentationYes (OASIS)
.epubapplication/epub+zipEPUB e-bookYes (W3C)
.icstext/calendariCalendarYes (RFC 5545)
.vcf, .vcardtext/vcardvCard contactYes (RFC 6350)
.zipapplication/zipZIP archiveYes (IANA template)
.gzapplication/gzipGzip archiveYes (RFC 6713)
.tarapplication/x-tarTape archive (TAR)No
.7zapplication/x-7z-compressed7-Zip archiveNo
.rarapplication/vnd.rarRAR archiveYes (vendor tree)
.bz2application/x-bzip2Bzip2 archiveNo
.jarapplication/java-archiveJava archive (JAR)Yes (JCP)
.zstapplication/zstdZstandard compressed dataYes (RFC 8878)
.html, .htmtext/htmlHTML pageYes (W3C)
.csstext/cssCSS stylesheetYes (W3C)
.js, .mjstext/javascriptJavaScript, classic scripts and modulesYes (RFC 9239)
.jsonapplication/jsonJSONYes (RFC 8259)
.jsonldapplication/ld+jsonJSON-LDYes (W3C)
.xmlapplication/xmlXMLYes (RFC 7303)
.xhtmlapplication/xhtml+xmlXHTML pageYes (W3C)
.wasmapplication/wasmWebAssembly moduleYes (W3C)
.webmanifestapplication/manifest+jsonWeb app manifestYes (W3C)
.atomapplication/atom+xmlAtom feedYes (RFC 4287, RFC 5023)
.yaml, .ymlapplication/yamlYAMLYes (RFC 9512)
.shapplication/x-shShell scriptNo
.binapplication/octet-streamAny binary dataYes (RFC 2045, RFC 2046)

How to find a file's MIME type

  1. 1
    Type 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.
  2. 2
    Read the matchThe result gives the MIME type, the Content-Type header to send, every extension that maps to it and whether IANA registers it.
  3. 3
    Copy the headerCopy the Content-Type line into your server, CDN or upload configuration; text types come with charset=utf-8.
  4. 4
    Browse 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?
text/javascript. RFC 9239, published in 2022, makes it the one media type for JavaScript and marks application/javascript, application/ecmascript and text/ecmascript obsolete. The same type covers .mjs module files.
What MIME type should a server send for an unknown file?
application/octet-stream, meaning arbitrary binary data. MDN says it is the default for anything that isn't text, and browsers treat it as a download rather than displaying it. Send X-Content-Type-Options: nosniff as well, so browsers don't guess a type from the bytes.
Is image/x-icon or image/vnd.microsoft.icon right for a favicon?
image/vnd.microsoft.icon is the one in IANA's registry, and the one MDN's common types table gives for .ico files. image/x-icon has no IANA entry. For PNG or SVG favicons, use image/png or image/svg+xml.
Do I need charset=utf-8 in the Content-Type header?
For text types, yes: MDN says that without a charset the default is US-ASCII unless the browser overrides it. For application/json, no: RFC 8259 defines no charset parameter and requires UTF-8. JavaScript modules are always read as UTF-8 under RFC 9239.
What does the x- prefix in a MIME type mean?
That the type was never registered. RFC 6838 says the unregistered x. tree is for private use and strongly discouraged, and that names starting with x- aren't part of it; a widely used x- type can be registered under its existing name. application/x-www-form-urlencoded is one that IANA now lists.

Sources

Related tools

See all 73 free tools

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