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

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