REF-008 • Web Reference Web

MIME Types Reference

A practical guide to common media types used for HTML, CSS, JavaScript, JSON, images, documents, audio, video, fonts, archives, downloads, and multipart form data.

Published
Web File Types HTTP Content-Type
type/subtype Standard Syntax
Content-Type HTTP Header
IANA Official Registry
Quick Answer

A MIME type, more formally called a media type, identifies the nature and format of content using a type/subtype value such as text/html, image/png, or application/json. On the web, servers normally send the media type in the HTTP Content-Type header so browsers and other clients know how the response should be handled.

Quick Lookup

Common MIME Types

This table covers many of the media types commonly encountered in browsers, web servers, APIs, downloads, office documents, and media files. A filename extension often suggests a likely media type, but the two are separate pieces of information.

Extension / Content MIME Type Family Typical Use
.html text/html Text HTML documents and web pages
.css text/css Text Cascading Style Sheets
.js text/javascript Text JavaScript source
.txt text/plain Text Plain text
.csv text/csv Text Comma-separated tabular data
.md text/markdown Text Markdown documents
.json application/json Application Structured JSON data and APIs
.xml application/xml Application Generic XML data
.webmanifest application/manifest+json Application Web application manifests
JSON-LD application/ld+json Application Linked data and structured data
.wasm application/wasm Application WebAssembly modules
.pdf application/pdf Application PDF documents
.zip application/zip Application ZIP archives
.gz application/gzip Application gzip-compressed data
.jpg / .jpeg image/jpeg Image JPEG images and photographs
.png image/png Image PNG images
.gif image/gif Image GIF images and animation
.webp image/webp Image WebP images and animation
.avif image/avif Image AVIF images
.svg image/svg+xml Image Scalable vector graphics
.heic image/heic Image HEIC images
.mp3 audio/mpeg Audio MP3 audio
.wav audio/wav Audio Waveform audio
.flac audio/flac Audio Lossless FLAC audio
.ogg audio/ogg Audio Ogg audio
.mp4 video/mp4 Video MP4 video
.webm video/webm Video WebM video
.ogv video/ogg Video Ogg video
.woff font/woff Font Web Open Font Format
.woff2 font/woff2 Font WOFF2 web fonts
.ttf font/ttf Font TrueType fonts
.otf font/otf Font OpenType fonts
Unknown binary application/octet-stream Application Generic binary data
Form upload multipart/form-data Multipart Forms containing fields and files
One Extension Does Not Always Mean One MIME Type

File extensions and media types are related, but there is not always a strict one-to-one mapping. A container, server configuration, application convention, or specific use of a format can affect the appropriate media type.

Type / Subtype

How MIME Types Work

A media type normally consists of a top-level type, a slash, and a more specific subtype. Parameters can optionally provide additional information.

Type text

The broad family of the content, such as text, image, audio, video, application, or font.

Subtype html

Identifies the more specific representation within the family. Together, the example becomes text/html.

Parameter charset=UTF-8

Optional information can follow a semicolon, as in text/html; charset=UTF-8.

Suffix +json

Structured syntax suffixes such as +json and +xml indicate that a subtype uses a broader syntax.

Top-Level Media Types

The IANA registry currently includes the top-level types application, audio, example, font, haptics, image, message, model, multipart, text, and video. Most everyday web work uses only a subset of these.

MIME Type vs Media Type

MIME type remains the familiar term, but media type is the broader standards terminology used by the modern registry and HTTP specifications.

Browser Resources

Web & Text MIME Types

Web browsers rely heavily on the media types supplied for page resources. HTML, CSS, JavaScript, structured data, and plain text each have established types.

Content MIME Type Typical Extension Purpose
HTML text/html .html Web documents
CSS text/css .css Stylesheets
JavaScript text/javascript .js Browser and application scripts
Plain text text/plain .txt Unformatted textual content
CSV text/csv .csv Delimited table data
Markdown text/markdown .md Lightweight text markup
JSON application/json .json Structured data and APIs
JSON-LD application/ld+json Often inline Linked data and structured metadata
XML application/xml .xml Generic XML documents and data
Web App Manifest application/manifest+json .webmanifest Web application metadata
WebAssembly application/wasm .wasm Compiled WebAssembly modules
JavaScript Uses text/javascript

Older sites and server configurations may still use values such as application/javascript. For modern JavaScript resources, text/javascript is the standardized media type.

Raster & Vector

Image MIME Types

Image media types use the image/ family. The subtype identifies the specific image representation, although the subtype does not always match the filename extension exactly.

Format MIME Type Extension Common Use
JPEG image/jpeg .jpg, .jpeg Photographs and compressed raster images
PNG image/png .png Graphics, screenshots, transparency
GIF image/gif .gif Graphics and simple animation
WebP image/webp .webp Modern web imagery
AVIF image/avif .avif High-efficiency web imagery
SVG image/svg+xml .svg Vector graphics and icons
APNG image/apng .apng Animated PNG imagery
HEIC image/heic .heic High-efficiency image storage
TIFF image/tiff .tif, .tiff Publishing, scanning, archival workflows
BMP image/bmp .bmp Bitmap imagery
SVG Uses +xml

SVG files use image/svg+xml. The +xml suffix communicates that the SVG representation uses XML syntax while still belonging to the image family.

Media Playback

Audio & Video MIME Types

Audio and video media types describe the representation delivered to the client. Container formats can hold different codecs, so the media type alone does not necessarily describe every codec contained inside a file.

Format MIME Type Extension Category
MP3 audio/mpeg .mp3 Audio
WAV audio/wav .wav Audio
FLAC audio/flac .flac Audio
AAC audio/aac .aac Audio
Ogg Audio audio/ogg .ogg, .oga Audio
MP4 Video video/mp4 .mp4 Video
WebM Video video/webm .webm Video
Ogg Video video/ogg .ogv Video
MPEG Video video/mpeg .mpeg, .mpg Video
MIME Type Is Not a Codec List

A value such as video/mp4 identifies an MP4 media representation, but playback can still depend on which audio and video codecs are inside the container and whether the client supports them.

Application Types

Documents, Data & Archives

The application family covers a wide range of structured documents, archives, data formats, application-specific packages, and binary content that does not fit naturally into another top-level family.

Content MIME Type Extension
PDF application/pdf .pdf
JSON application/json .json
XML application/xml .xml
ZIP application/zip .zip
gzip application/gzip .gz
RAR application/vnd.rar .rar
Word Open XML application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
Excel Open XML application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx
PowerPoint Open XML application/vnd.openxmlformats-officedocument.presentationml.presentation .pptx
Generic binary data application/octet-stream Varies
application/octet-stream

application/octet-stream is the generic media type for arbitrary binary data when a more specific type is unknown or inappropriate. Browsers commonly treat this content conservatively and may offer it as a download.

MIME Type and File Extension Are Different

The extension .pdf is part of a filename. application/pdf is metadata describing the content. See the File Extensions reference for a broader explanation of filename suffixes and formats.

Additional Families

Fonts, Multipart & Other Types

Not every media type belongs to text, application, image, audio, or video. Fonts have their own top-level family, while multipart types describe messages made from multiple parts.

Content MIME Type Typical Use
WOFF font/woff Web fonts
WOFF2 font/woff2 Compressed modern web fonts
TrueType font/ttf TrueType font resources
OpenType font/otf OpenType font resources
HTML form data multipart/form-data Forms containing fields and file uploads
Byte ranges multipart/byteranges Multiple byte ranges in one response
Email message message/rfc822 Encapsulated Internet message

multipart/form-data

When a browser submits a form containing uploaded files, the request can use multipart/form-data. The body is divided into separate parts using a boundary, and individual parts can carry their own headers and media types.

Do Not Manually Guess the Multipart Boundary

Browser APIs normally generate the required boundary when creating a multipart form request. Manually overriding the complete Content-Type header can break a request when the boundary no longer matches the body.

Type Family Comparison

Common MIME Type Patterns

The top-level type gives a quick indication of the broad content family. The subtype then narrows that category to a specific representation.

Text HTML

Human-readable textual content interpreted as an HTML document.

Application JSON

Structured data commonly exchanged by APIs and web applications.

Image PNG

Raster image data using the Portable Network Graphics format.

Video MP4

Video media represented using the MP4 container family.

Font WOFF2

Compressed font data designed for efficient web delivery.

Multipart Form Data

Multiple form fields and uploaded files contained in one request body.

Content Negotiation & Security

MIME Types in HTTP

On the web, media types are especially important because they help describe HTTP request and response bodies. Correct headers let browsers, APIs, proxies, and other clients interpret content consistently.

Content-Type What This Is

Describes the media type of the current request or response body, such as application/json.

Accept What I Can Receive

A client can use the Accept header to indicate which response media types it can handle.

Content-Disposition Display or Download

Helps indicate whether content should be displayed inline or offered as an attachment, and can suggest a filename.

nosniff Do Not Guess

X-Content-Type-Options: nosniff tells supporting browsers not to override declared types through MIME sniffing in applicable contexts.

Example Content-Type Headers

Resource Content-Type
HTML page Content-Type: text/html; charset=UTF-8
CSS stylesheet Content-Type: text/css
JavaScript file Content-Type: text/javascript
JSON API response Content-Type: application/json
PNG image Content-Type: image/png
PDF document Content-Type: application/pdf
Incorrect Types Can Break Resources

A browser may refuse to use a resource when the server declares an incompatible media type. Stylesheets, scripts, fonts, modules, and other resources can fail even when the file itself exists and the URL returns a successful HTTP response.

MIME Sniffing

Some clients can inspect response bytes and attempt to infer a type when metadata is absent or questionable. Servers should still send the correct Content-Type rather than relying on clients to guess.

FAQ

MIME Type Questions

What does MIME type mean?

MIME stands for Multipurpose Internet Mail Extensions. The term MIME type is commonly used for a standardized media type such as text/html or image/png that identifies the nature and format of content.

What is the difference between a MIME type and a file extension?

A file extension is part of a filename, such as .png or .json. A MIME type is metadata such as image/png or application/json. They are often related, but they are not the same thing.

What MIME type should JavaScript use?

Modern JavaScript resources should use text/javascript. Older values such as application/javascript can still appear in legacy systems, but text/javascript is the current standardized type.

What is application/octet-stream?

application/octet-stream is the generic media type for arbitrary binary data when a more specific media type is unknown or inappropriate. Browsers commonly treat it as downloadable binary content rather than assuming a specific format.

What is the MIME type for JSON?

The standard media type for ordinary JSON data is application/json. Specialized formats built on JSON can use their own registered types, sometimes with the +json structured syntax suffix.

What is multipart/form-data?

multipart/form-data is a multipart media type commonly used when a browser submits form fields and uploaded files. The request body is divided into separate parts using a boundary.

Can the wrong MIME type break a website?

Yes. Browsers use media types when deciding how content should be interpreted. An incorrect Content-Type can cause stylesheets, scripts, fonts, images, downloads, or other resources to be handled incorrectly or blocked.