Skip to content
back to cheatsheets

MIME Types Cheatsheet — Common Content Types for Web Development

· Reference

MIME types (Multipurpose Internet Mail Extensions), also called media types or content types, tell browsers and servers what kind of data is being transmitted. They appear in Content-Type headers, <link> and <script> tags, file upload handling, and API responses. Getting the MIME type wrong can cause files to download instead of display, or trigger security warnings.

The format is always type/subtype, optionally followed by parameters like ; charset=utf-8.

Text Types

MIME TypeExtension(s)Description
text/html.html, .htmHTML documents
text/css.cssCSS stylesheets
text/javascript.js, .mjsJavaScript (preferred over application/javascript)
text/plain.txtPlain text
text/csv.csvComma-separated values
text/xml.xmlXML (when readable by humans)
text/markdown.mdMarkdown documents
text/calendar.icsiCalendar files
text/tab-separated-values.tsvTab-separated values
text/yaml.yaml, .ymlYAML documents

Always include charset=utf-8 for text types:

Content-Type: text/html; charset=utf-8

Image Types

MIME TypeExtension(s)Description
image/png.pngPNG images
image/jpeg.jpg, .jpegJPEG images
image/gif.gifGIF images (static or animated)
image/webp.webpWebP images (modern, smaller files)
image/avif.avifAVIF images (best compression)
image/svg+xml.svgSVG vector graphics
image/x-icon.icoFavicons (legacy)
image/vnd.microsoft.icon.icoFavicons (official)
image/bmp.bmpBitmap images
image/tiff.tiff, .tifTIFF images
image/apng.apngAnimated PNG

Audio Types

MIME TypeExtension(s)Description
audio/mpeg.mp3MP3 audio
audio/ogg.ogg, .ogaOgg Vorbis audio
audio/wav.wavWAV audio
audio/webm.webaWebM audio
audio/aac.aacAAC audio
audio/flac.flacFLAC lossless audio
audio/midi.mid, .midiMIDI audio
audio/opus.opusOpus audio

Video Types

MIME TypeExtension(s)Description
video/mp4.mp4MP4 video
video/webm.webmWebM video
video/ogg.ogvOgg video
video/mpeg.mpegMPEG video
video/quicktime.movQuickTime video
video/x-msvideo.aviAVI video
video/x-matroska.mkvMatroska video
video/3gpp.3gp3GPP video

Application Types

MIME TypeExtension(s)Description
application/json.jsonJSON data
application/xml.xmlXML data (machine-readable)
application/pdf.pdfPDF documents
application/zip.zipZIP archives
application/gzip.gzGzip compressed files
application/x-tar.tarTar archives
application/x-7z-compressed.7z7-Zip archives
application/x-rar-compressed.rarRAR archives
application/octet-stream(any)Binary data (generic download)
application/x-www-form-urlencodedHTML form data (default encoding)
application/ld+json.jsonldJSON-LD (linked data / structured data)
application/graphql.graphqlGraphQL queries
application/wasm.wasmWebAssembly binary
application/manifest+json.webmanifestWeb app manifest
application/rss+xml.rssRSS feeds
application/atom+xml.atomAtom feeds
application/xhtml+xml.xhtmlXHTML documents
application/sql.sqlSQL scripts
application/toml.tomlTOML configuration
application/vnd.api+jsonJSON:API responses

Office Document Types

MIME TypeExtensionDescription
application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxWord document
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsxExcel spreadsheet
application/vnd.openxmlformats-officedocument.presentationml.presentation.pptxPowerPoint presentation
application/vnd.ms-excel.xlsLegacy Excel
application/msword.docLegacy Word
application/vnd.oasis.opendocument.text.odtOpenDocument text
application/vnd.oasis.opendocument.spreadsheet.odsOpenDocument spreadsheet
application/epub+zip.epubEPUB ebook

Font Types

MIME TypeExtensionDescription
font/woff.woffWOFF font
font/woff2.woff2WOFF2 font (preferred for web)
font/ttf.ttfTrueType font
font/otf.otfOpenType font
font/collection.ttcFont collection

Multipart Types

Used for file uploads and email.

MIME TypeUsage
multipart/form-dataFile uploads via HTML forms
multipart/byterangesPartial content responses (206)
multipart/mixedEmail with attachments
multipart/alternativeEmail with HTML and plain text versions
<!-- File upload form -->
<form enctype="multipart/form-data" method="POST">
  <input type="file" name="document" accept=".pdf,.docx" />
</form>

Setting MIME Types

# Nginx
types {
    application/json  json;
    font/woff2        woff2;
}

# Apache (.htaccess)
AddType application/json .json
AddType font/woff2 .woff2

# Express.js
res.type('application/json');
res.set('Content-Type', 'text/html; charset=utf-8');

# Fetch API
fetch('/api', {
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(data)
});

Look up any MIME type with the MIME Types Reference tool.

#Learn More