Developer Toolbox

MIME Types

The media types you are likely to send or receive, with their file extensions, and how the Content-Type header around them works. The common ones have a page of their own with curl and fetch examples.

Open cURL Builder Build a request and set its Content-Type.

Common MIME types

67 types
TypeExtensionsWhat it isGuide
Text
text/plain.txtPlain text, no markup.Guide to text/plain
text/html.html .htmAn HTML document.Guide to text/html
text/css.cssA stylesheet.
text/javascript.js .mjsJavaScript, scripts and modules alike.Guide to text/javascript
text/csv.csvComma-separated values, one record per line.Guide to text/csv
text/tab-separated-values.tsvTab-separated values.
text/markdown.mdMarkdown text.
text/calendar.icsAn iCalendar event or calendar.
text/vcard.vcfA contact card.
text/event-streamServer-sent events: a stream of messages over one response.Guide to text/event-stream
Application
application/json.jsonJSON data.Guide to application/json
application/ld+json.jsonldJSON-LD linked data, as used for structured data in web pages.
application/problem+jsonAn API error in the RFC 9457 problem details format.
application/x-ndjson.ndjsonNewline-delimited JSON: one JSON value per line.
application/xml.xmlAn XML document.Guide to application/xml
application/atom+xml.atomAn Atom feed.
application/rss+xml.rssAn RSS feed.
application/yaml.yaml .ymlYAML, registered in 2024 (RFC 9512); older servers send other names.
application/x-www-form-urlencodedForm fields as name=value pairs joined with &.Guide to application/x-www-form-urlencoded
application/octet-stream.binArbitrary bytes: the type to use when no other fits.Guide to application/octet-stream
application/pdf.pdfA PDF document.Guide to application/pdf
application/zip.zipA ZIP archive.Guide to application/zip
application/gzip.gzA gzip-compressed file.
application/x-tar.tarA tar archive.
application/x-7z-compressed.7zA 7-Zip archive.
application/vnd.rar.rarA RAR archive.
application/java-archive.jarA Java archive.
application/wasm.wasmA WebAssembly module; streaming compilation requires this exact type.
application/manifest+json.webmanifestA web app manifest.
application/sql.sqlSQL statements.
application/rtf.rtfRich Text Format.
application/epub+zip.epubAn EPUB e-book.
application/msword.docA Word document, the old binary format.
application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxA Word document.
application/vnd.ms-excel.xlsAn Excel workbook, the old binary format.
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsxAn Excel workbook.
application/vnd.openxmlformats-officedocument.presentationml.presentation.pptxA PowerPoint presentation.
application/vnd.oasis.opendocument.text.odtAn OpenDocument text document.
Multipart
multipart/form-dataForm fields and files in one body, split by a boundary.Guide to multipart/form-data
multipart/byterangesSeveral byte ranges of one resource, in a 206 response.
multipart/mixedSeveral parts of different types, as in email.
Image
image/png.pngA PNG image.
image/jpeg.jpg .jpegA JPEG image.
image/gif.gifA GIF image or animation.
image/webp.webpA WebP image.Guide to image/webp
image/avif.avifAn AVIF image.
image/svg+xml.svgAn SVG vector image.Guide to image/svg+xml
image/vnd.microsoft.icon.icoAn icon file; image/x-icon is the older name most servers send.
image/bmp.bmpA bitmap image.
image/tiff.tif .tiffA TIFF image.
image/heic.heicA HEIC image, the default photo format on iPhones.
Audio
audio/mpeg.mp3MP3 audio.
audio/ogg.ogg .ogaOgg audio, usually Vorbis or Opus.
audio/wav.wavWAV audio; some servers send audio/x-wav.
audio/webm.webaWebM audio.
audio/aac.aacAAC audio.
audio/flac.flacFLAC lossless audio.
audio/mp4.m4aAudio in an MP4 container.
Video
video/mp4.mp4MP4 video.
video/webm.webmWebM video.
video/ogg.ogvOgg video.
video/quicktime.movQuickTime video.
video/x-msvideo.aviAVI video.
Font
font/woff2.woff2A WOFF2 web font, the format to serve today.
font/woff.woffA WOFF web font.
font/ttf.ttfA TrueType font.
font/otf.otfAn OpenType font.

Anatomy of the header

Content-Type: text/csv; charset=utf-8 is a type (text), a subtype (csv) and optional parameters after semicolons. Text types take a charset; multipart/form-data takes a boundary, the string that, after two dashes, separates its parts. Type and subtype are case-insensitive.

Content-Type and Accept

Content-Type says what this message's body is, in a request or a response. Accept says what the client wants back, with an optional preference: Accept: application/json, text/plain;q=0.5.

Sniffing and nosniff

Browsers may guess a type from the first bytes when the header is missing or vague. X-Content-Type-Options: nosniff stops that: scripts and stylesheets with the wrong type are then refused, which is what you want for user uploads.

When the type is wrong

A server that can't read the body's type answers 415. One that reads it but finds the content broken answers 400 or 422.

Guides

14 types