What Is a MIME Type?
A MIME type (Multipurpose Internet Mail Extensions type, also called Media Type or Content Type) is a label that identifies the format of data. Originally created for email attachments, MIME types are now used everywhere data format identification is needed — HTTP responses, file uploads, data URLs, and HTML.
MIME Type Syntax
MIME types follow this format:
type/subtype
type/subtype; parameter=value
Examples:
text/html— HTML documenttext/html; charset=UTF-8— HTML with encoding parameterapplication/json— JSON dataimage/png— PNG imagemultipart/form-data; boundary=something— Form data with boundary
MIME Type Categories
text
Human-readable text content:
text/plain— Plain texttext/html— HTML markuptext/css— CSS stylesheetstext/javascript— JavaScript (thoughapplication/javascriptis more accurate)text/csv— CSV data
image
Visual content:
image/jpeg— JPEG photosimage/png— PNG with transparencyimage/gif— Animated GIFsimage/webp— Modern efficient formatimage/svg+xml— SVG vector graphicsimage/avif— AV1 Image File Format (modern, high efficiency)
audio
Sound content:
audio/mpeg— MP3 audioaudio/ogg— Ogg Vorbisaudio/wav— Uncompressed audioaudio/aac— AAC audioaudio/webm— WebM audio
video
Video content:
video/mp4— MP4 videovideo/webm— WebM videovideo/ogg— Ogg Theora
application
Non-text binary or structured data:
application/json— JSON dataapplication/xml— XML dataapplication/pdf— PDF documentsapplication/zip— ZIP archivesapplication/gzip— Gzip compressedapplication/octet-stream— Unknown binary (generic binary)application/x-www-form-urlencoded— HTML form data
multipart
Composite content with multiple parts:
multipart/form-data— File upload formsmultipart/mixed— Email with attachments
MIME Types in HTTP
The Content-Type header tells the recipient what format the response body is in:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{"status": "ok"}
The Accept header tells the server what formats the client can handle:
GET /api/users HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type in HTML Forms
HTML form encoding is controlled by the enctype attribute:
<!-- URL-encoded (default) -->
<form method="post" enctype="application/x-www-form-urlencoded">
<!-- Required for file uploads -->
<form method="post" enctype="multipart/form-data">
Common MIME Type Pitfalls
application/octet-stream
The generic binary type. Browsers download rather than display files with this type. Use specific types for correct browser handling.
text/javascript vs. application/javascript
Both are widely used; modern spec recommends text/javascript. In practice, both work in browsers.
application/x-www-form-urlencoded vs. multipart/form-data
For API POST requests with JSON body, use application/json. Use multipart/form-data only when uploading actual binary files.
MIME Sniffing
Some browsers ignore the declared Content-Type and "sniff" the actual content to determine the type. This can be a security risk. The X-Content-Type-Options: nosniff header prevents this behavior.
File Extensions to MIME Types
Common mappings:
| Extension | MIME Type |
|---|---|
| .html | text/html |
| .css | text/css |
| .js | text/javascript |
| .json | application/json |
| .png | image/png |
| .jpg | image/jpeg |
| application/pdf | |
| .zip | application/zip |
| .mp4 | video/mp4 |
| .mp3 | audio/mpeg |
Using the MIME Types Reference Tool
Our tool:
- Search by extension — find the MIME type for any file extension
- Search by MIME type — find the file extension for any MIME type
- Browse categories — explore all types in a category
- Copy type — one-click copy for use in code
- See browser support — which types browsers handle natively
Essential reference for web developers setting Content-Type headers, handling file uploads, and configuring web servers.