Skip to content

MIME types

A MIME type — the value of the Content-Type header — is how a server says what a file is. Nothing about the filename reaches the browser, so the extension is a hint for you and the type is the fact for the client. Get it wrong and a stylesheet is ignored, a font fails to load, or a PDF downloads when it should have opened.

This page lists the extension and the type the site's own lookup tool returns for it, so the two can never disagree. Where several extensions share one type — jpg, jpeg and jpe, or yaml and yml — each is listed on its own row, because you look up the one you have.

Two rules explain most of the surprises below. A type beginning application/vnd. is a vendor's registration rather than an open standard, which is why the Office types are so long. And a type the server does not know is best sent as application/octet-stream, which tells the browser to download rather than to guess.

Web and text

21

text/* is the family a browser will show rather than download, and the only one where a charset parameter matters — text/html; charset=utf-8.

ExtensionMIME typeWhat it is
.htmltext/htmlHTML document
.htmtext/htmlHTML document, the short extension
.shtmltext/htmlHTML with server-side includes
.xhtmlapplication/xhtml+xmlXHTML document
.csstext/cssStylesheet
.csvtext/csvComma-separated values
.txttext/plainPlain text
.mdtext/markdownMarkdown source
.icstext/calendarCalendar event
.xmlapplication/xmlXML document
.jstext/javascriptJavaScript
.mjstext/javascriptJavaScript ES module
.jsonapplication/jsonJSON data
.jsonldapplication/ld+jsonJSON-LD structured data
.webmanifestapplication/manifest+jsonWeb app manifest
.yamlapplication/yamlYAML document
.ymlapplication/yamlYAML, the short extension
.tomlapplication/tomlTOML configuration
.sqlapplication/sqlSQL script
.shapplication/x-shShell script
.wasmapplication/wasmWebAssembly module

Documents

12

The Office types are long because they encode the vendor, the standard and the part — vnd. means a vendor registration rather than an open format.

ExtensionMIME typeWhat it is
.pdfapplication/pdfPDF document
.rtfapplication/rtfRich text
.docapplication/mswordWord document, legacy binary
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentWord document
.xlsapplication/vnd.ms-excelExcel workbook, legacy binary
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetExcel workbook
.pptapplication/vnd.ms-powerpointPowerPoint presentation, legacy binary
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationPowerPoint presentation
.odtapplication/vnd.oasis.opendocument.textOpenDocument text
.odsapplication/vnd.oasis.opendocument.spreadsheetOpenDocument spreadsheet
.odpapplication/vnd.oasis.opendocument.presentationOpenDocument presentation
.epubapplication/epub+zipEPUB e-book

Images

14

Every image type is sniffable from its first bytes, so a browser will usually render one correctly even when the server labels it wrong. SVG is the exception you should never mislabel — it is a document that can carry script.

ExtensionMIME typeWhat it is
.pngimage/pngPNG image
.jpgimage/jpegJPEG image
.jpegimage/jpegJPEG image, the long extension
.jpeimage/jpegJPEG image, a rare extension
.gifimage/gifGIF image
.webpimage/webpWebP image
.avifimage/avifAVIF image
.svgimage/svg+xmlSVG vector image
.bmpimage/bmpBitmap image
.icoimage/vnd.microsoft.iconIcon file
.tifimage/tiffTIFF image
.tiffimage/tiffTIFF image, the long extension
.heicimage/heicHEIC image
.heifimage/heifHEIF image

Audio

11

Container and codec are different questions. audio/ogg says how the file is wrapped; what is inside it may be Vorbis, Opus or FLAC.

ExtensionMIME typeWhat it is
.mp3audio/mpegMP3 audio
.wavaudio/wavWAV audio
.oggaudio/oggOgg audio
.ogaaudio/oggOgg audio, the explicit extension
.opusaudio/opusOpus audio
.m4aaudio/mp4AAC audio in an MP4 container
.flacaudio/flacFLAC lossless audio
.webaaudio/webmWebM audio
.aacaudio/aacRaw AAC audio
.midaudio/midiMIDI sequence
.midiaudio/midiMIDI, the long extension

Video

9

Streaming a video needs more than the right type — the server also has to answer range requests, or the browser downloads the whole file before it plays.

ExtensionMIME typeWhat it is
.mp4video/mp4MP4 video
.m4vvideo/mp4MP4 video, Apple's extension
.webmvideo/webmWebM video
.ogvvideo/oggOgg video
.movvideo/quicktimeQuickTime video
.avivideo/x-msvideoAVI video
.mkvvideo/x-matroskaMatroska video
.wmvvideo/x-ms-wmvWindows Media video
.3gpvideo/3gpp3GPP mobile video

Fonts

5

The font/* family was registered late; older tooling still emits application/font-woff and application/x-font-ttf, which browsers accept but should not be written for anything new.

ExtensionMIME typeWhat it is
.wofffont/woffWOFF web font
.woff2font/woff2WOFF2 web font
.ttffont/ttfTrueType font
.otffont/otfOpenType font
.eotapplication/vnd.ms-fontobjectEmbedded OpenType, Internet Explorer only

Archives and binaries

12

application/octet-stream is the honest answer when nothing better is known, and it is also what forces a download instead of a render.

ExtensionMIME typeWhat it is
.zipapplication/zipZIP archive
.gzapplication/gzipGzip archive
.tarapplication/x-tarTar archive
.7zapplication/x-7z-compressed7-Zip archive
.rarapplication/vnd.rarRAR archive
.bz2application/x-bzip2Bzip2 archive
.isoapplication/x-iso9660-imageDisc image
.binapplication/octet-streamUnknown binary data
.exeapplication/x-msdownloadWindows executable
.apkapplication/vnd.android.package-archiveAndroid package
.debapplication/vnd.debian.binary-packageDebian package
.swfapplication/x-shockwave-flashFlash movie, long obsolete

FAQ

What happens if the MIME type is wrong?
It depends on the type. Browsers refuse a stylesheet that does not arrive as text/css and a module script that does not arrive as a JavaScript type, both on purpose. Images are sniffed from their first bytes and usually survive a wrong label. And anything served as text/plain is shown rather than downloaded.
Is text/javascript or application/javascript correct?
text/javascript. It was the historical form, application/javascript replaced it, and the current standard has gone back to text/javascript and marks the other obsolete. Every browser accepts both, so this only matters for what you write in new configuration.
Why is the Word .docx type so long?
Because it encodes the whole path to the format: a vendor registration (vnd.), the OOXML family, and which of that family's documents it is. The length is the price of a registry entry that cannot collide with anyone else's.
Do I need a charset on every type?
Only on text types, and in practice only where the default would be wrong. text/html; charset=utf-8 is worth being explicit about; image/png; charset=utf-8 is meaningless. JSON is defined as UTF-8 already, so application/json takes no charset.
How do I look one up quickly?
The MIME type lookup tool on this site converts a list of extensions to types, or types back to extensions, and can emit the result as an nginx or Apache configuration block.