MIME Types Reference
Look up MIME types by file family, with the pitfalls of using them wrong
79 types
text/plainText.txt .log .ini .conf
Plain text; the safe default when nothing else fits.
text/htmlText.html .htm
HTML document; browsers switch to the HTML parser on this type.
Watch out: Always send a charset, otherwise CJK text may be decoded wrongly.
text/cssText.css
Stylesheet; the charset parameter replaces a @charset rule.
text/javascriptText.js .mjs
The spec-preferred JS type; application/javascript is legacy.
Watch out: Use it for module scripts too; application/javascript gets rejected.
text/markdownText.md .markdown
Markdown source; servers usually serve it as a download.
text/csvText.csv
Comma-separated values; garbled Excel output usually means missing charset or BOM.
Watch out: For Excel to read UTF-8 Chinese, prepend a BOM.
text/tab-separated-valuesText.tsv
Tab-separated values.
text/calendarText.ics
Calendar events; mail clients turn these into invites.
text/vcardText.vcf
Contact card.
text/event-streamText.sse
Server-sent events; must be paired with Cache-Control: no-cache.
Watch out: Proxy buffering makes events arrive late; disable proxy_buffering.
application/jsonStructured data.json .map
JSON payload; the default for APIs.
Watch out: Do not append charset: JSON is UTF-8 by spec.
application/ld+jsonStructured data.jsonld
Structured data for SEO rich results.
application/merge-patch+jsonStructured data—
JSON Merge Patch (RFC 7396) for PATCH requests.
application/json-patch+jsonStructured data—
JSON Patch (RFC 6902), an array of operations.
application/x-ndjsonStructured data.ndjson .jsonl
One JSON value per line; common for logs and streaming exports.
application/xmlStructured data.xml
XML document; the preferred type (text/xml is obsolete).
application/xhtml+xmlStructured data.xhtml
XHTML parsed strictly as XML; one unclosed tag breaks the page.
application/yamlStructured data.yaml .yml
YAML document, common for configs and Kubernetes manifests.
application/graphqlStructured data.graphql
GraphQL query text.
application/x-protobufStructured data.proto .pb
Protocol Buffers binary, more compact than JSON.
application/wasmStructured data.wasm
WebAssembly module; application/wasm is required for streaming compilation.
Watch out: Serving octet-stream disables streaming compilation and slows startup.
application/pdfDocumentsPDF document; browsers open it inline or download.
application/mswordDocuments.doc
Legacy Word 97-2003 format.
application/vnd.openxmlformats-officedocument.wordprocessingml.documentDocuments.docx
Word document in OOXML, the modern format.
application/vnd.ms-excelDocuments.xls
Legacy Excel 97-2003 format.
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetDocuments.xlsx
Excel workbook in OOXML.
application/vnd.ms-powerpointDocuments.ppt
Legacy PowerPoint 97-2003 format.
application/vnd.openxmlformats-officedocument.presentationml.presentationDocuments.pptx
PowerPoint presentation in OOXML.
application/vnd.oasis.opendocument.textDocuments.odt
OpenDocument text document.
application/vnd.oasis.opendocument.spreadsheetDocuments.ods
OpenDocument spreadsheet.
application/rtfDocuments.rtf
Rich Text Format, widely portable.
application/epub+zipDocuments.epub
E-book; it is a zip container, hence the +zip suffix.
image/pngImages.png
Lossless bitmap with alpha support.
image/jpegImages.jpg .jpeg
Lossy photo format; no alpha channel.
image/gifImages.gif
Only 256 colors; supports animation and transparency.
image/webpImages.webp
Both lossy and lossless; smaller than JPEG.
image/avifImages.avif
AV1-based, better compression but slower to encode.
image/svg+xmlImages.svg
Vector format; it is executable text, treat linked SVGs as untrusted.
Watch out: Opening uploaded SVGs inline executes embedded scripts; force attachment.
image/bmpImages.bmp
Uncompressed bitmap, large files.
image/tiffImages.tif .tiff
Common in print and scanning; multi-page and lossless.
image/x-iconImages.ico
Favicon used in browser tabs.
image/heicImages.heic .heif
Default camera format on Apple devices; not supported by older browsers.
image/apngImages.apng
Animated PNG with full alpha.
image/jxlImages.jxl
JPEG XL with strong compression and lossless, limited browser support.
audio/mpegAudio.mp3
MP3 audio, the most compatible.
audio/oggAudio.ogg .oga
Ogg container, usually Vorbis or Opus.
audio/wavAudio.wav
Uncompressed audio, large files.
audio/webmAudio.weba
WebM audio container.
audio/aacAudio.aac .m4a
AAC audio, common on Apple devices.
audio/flacAudio.flac
Lossless compressed audio.
audio/opusAudio.opus
Best voice quality at low bitrates; common in real-time calls.
audio/midiAudio.mid .midi
MIDI instructions, not an audio waveform.
video/mp4Video.mp4 .m4v
MP4 video, the most compatible.
video/webmVideo.webm
WebM video, natively supported in browsers.
video/oggVideo.ogv
Ogg video container.
video/quicktimeVideo.mov
QuickTime video, common in editing workflows.
video/x-msvideoVideo.avi
Legacy AVI format.
video/mpegVideo.mpeg .mpg
MPEG video.
video/x-matroskaVideo.mkv
Matroska container, supports multiple tracks and subtitles.
video/mp2tVideo.ts
MPEG transport stream used by HLS; unrelated to TypeScript files.
font/woffFonts.woff
Web font (WOFF), widely supported.
font/woff2Fonts.woff2
WOFF2, best compression; prefer this one.
font/ttfFonts.ttf
TrueType font.
font/otfFonts.otf
OpenType font.
font/collectionFonts.ttc
Font collection holding multiple faces.
application/zipArchives.zip
ZIP archive.
application/gzipArchives.gz .tgz
gzip compresses a single stream; pair it with tar to bundle files.
application/x-tarArchives.tar
tar archive; it does not compress by itself.
application/x-7z-compressedArchives.7z
7z archive with a high compression ratio.
application/vnd.rarArchives.rar
RAR archive; the official type is now vnd.rar.
application/x-bzip2Archives.bz2
bzip2, smaller than gzip but slower.
application/zstdArchives.zst
Zstandard, a good speed-to-ratio balance.
application/x-xzArchives.xz
xz, best ratio but heavier on CPU.
application/octet-streamStreams and fallback.bin 未知类型
Fallback for unknown binary; browsers always download it.
Watch out: Using it as a default turns images and PDFs into downloads.
multipart/form-dataStreams and fallback—
Required for file uploads; urlencoded cannot carry binary.
application/x-www-form-urlencodedStreams and fallback—
Default encoding for plain forms; key-value pairs are URL-escaped.
multipart/byterangesStreams and fallback—
Response body type for ranged and resumable downloads.
application/dash+xmlStreams and fallback.mpd
MPEG-DASH streaming manifest.
application/vnd.apple.mpegurlStreams and fallback.m3u8
HLS playlist, natively supported by Safari.
Something broken or missing?
Send feedback