MIME Type Reference
Comprehensive reference table for MIME types (Content-Types) and file extensions.
Back to all tools on ToolForge
About MIME Type Reference
This reference lists MIME types used in HTTP Content-Type headers, file uploads, email attachments, and web APIs. MIME types follow the format type/subtype where type is the general category (text, image, application) and subtype specifies the exact format.
Correct MIME types ensure browsers render content properly, downloads work correctly, and APIs parse data as expected.
MIME Type Structure
Format: type/subtype[; parameters] Types: application - Binary data, application-specific formats audio - Audio files and streams font - Font files (WOFF, TTF, OTF) image - Image files (PNG, JPEG, GIF, SVG) message - Email messages, MIME parts model - 3D models, CAD files multipart - Multiple parts (form-data, signed messages) text - Text files (HTML, CSS, JavaScript, plain text) video - Video files and streams Parameters: charset=utf-8 - Character encoding for text types boundary=... - Boundary for multipart types
Setting Content-Type in Different Contexts
// HTTP Response Header
Content-Type: text/html; charset=utf-8
// Apache (.htaccess)
AddType application/json .json
AddType image/webp .webp
// Nginx (nginx.conf)
types {
application/json json;
image/webp webp;
}
// Node.js Express
res.setHeader('Content-Type', 'application/json');
res.json({ key: 'value' });
// PHP
header('Content-Type: application/json');
echo json_encode($data);
// Python Flask
return jsonify({'key': 'value'}) # Auto-sets application/json
// HTML file input accept
<input type="file" accept="image/png,image/jpeg">
// JavaScript fetch
fetch('/api', {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
MIME Types by Category
Text Formats
| MIME Type | Extensions | Description |
|---|---|---|
text/html | .html, .htm | HTML document |
text/css | .css | CSS stylesheet |
text/javascript | .js, .mjs | JavaScript file |
text/plain | .txt, .text | Plain text |
text/xml | .xml | XML document |
text/csv | .csv | Comma-separated values |
text/markdown | .md, .markdown | Markdown document |
text/yaml | .yaml, .yml | YAML data |
text/rtf | .rtf | Rich Text Format |
Application/Data Formats
| MIME Type | Extensions | Description |
|---|---|---|
application/json | .json | JSON data |
application/xml | .xml | XML document |
application/pdf | PDF document | |
application/msword | .doc | Microsoft Word |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | .docx | Word 2007+ |
application/vnd.ms-excel | .xls | Microsoft Excel |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | .xlsx | Excel 2007+ |
application/vnd.ms-powerpoint | .ppt | PowerPoint |
application/vnd.openxmlformats-officedocument.presentationml.presentation | .pptx | PowerPoint 2007+ |
application/rtf | .rtf | Rich Text Format |
application/x-www-form-urlencoded | — | Form submission |
application/graphql | — | GraphQL query |
Image Formats
| MIME Type | Extensions | Description |
|---|---|---|
image/jpeg | .jpg, .jpeg | JPEG image |
image/png | .png | PNG image |
image/gif | .gif | GIF image |
image/webp | .webp | WebP image |
image/svg+xml | .svg | SVG vector image |
image/x-icon | .ico | Favicon |
image/bmp | .bmp | Bitmap image |
image/tiff | .tif, .tiff | TIFF image |
image/avif | .avif | AV1 image format |
image/heic | .heic | HEIF image (Apple) |
Audio Formats
| MIME Type | Extensions | Description |
|---|---|---|
audio/mpeg | .mp3 | MP3 audio |
audio/wav | .wav | WAV audio |
audio/ogg | .ogg | Ogg Vorbis |
audio/webm | .webm | WebM audio |
audio/mp4 | .m4a, .aac | AAC/M4A audio |
audio/flac | .flac | FLAC lossless |
audio/midi | .mid, .midi | MIDI file |
Video Formats
| MIME Type | Extensions | Description |
|---|---|---|
video/mp4 | .mp4, .m4v | MP4 video |
video/webm | .webm | WebM video |
video/ogg | .ogv | Ogg video |
video/quicktime | .mov | QuickTime |
video/x-msvideo | .avi | AVI video |
video/x-matroska | .mkv | Matroska |
video/mpeg | .mpeg, .mpg | MPEG video |
Archive/Compressed Formats
| MIME Type | Extensions | Description |
|---|---|---|
application/zip | .zip | ZIP archive |
application/gzip | .gz, .gzip | Gzip compressed |
application/x-tar | .tar | TAR archive |
application/x-rar-compressed | .rar | RAR archive |
application/x-7z-compressed | .7z | 7-Zip archive |
application/x-bzip2 | .bz2 | Bzip2 compressed |
application/x-xz | .xz | XZ compressed |
Font Formats
| MIME Type | Extensions | Description |
|---|---|---|
font/woff | .woff | WOFF font |
font/woff2 | .woff2 | WOFF2 font |
font/ttf | .ttf | TrueType font |
font/otf | .otf | OpenType font |
application/font-sfnt | .ttf, .otf | SFNT fonts (legacy) |
Multipart/Binary
| MIME Type | Extensions | Description |
|---|---|---|
multipart/form-data | — | File upload form |
multipart/mixed | — | Mixed content parts |
application/octet-stream | .bin, .data | Generic binary |
application/x-executable | .exe | Executable binary |
Frequently Asked Questions
- What is a MIME type?
- MIME (Multipurpose Internet Mail Extensions) type is a standardized identifier that tells browsers and servers what type of file is being transmitted. Format: type/subtype (e.g., text/html, image/png). MIME types are used in Content-Type headers, file uploads, and API responses.
- Why are MIME types important?
- MIME types ensure correct file handling: browsers render HTML/CSS properly, plugins handle specific formats, downloads get correct extensions, and APIs parse request/response bodies. Wrong MIME types cause security issues, broken downloads, and rendering problems.
- What is the Content-Type header?
- Content-Type is an HTTP header that specifies the MIME type of a resource. Example: 'Content-Type: text/html; charset=utf-8'. Servers send this with responses; clients send it with POST/PUT requests containing body data (forms, JSON, file uploads).
- What is application/octet-stream?
- application/octet-stream is the generic MIME type for binary data. Used when the specific type is unknown or when forcing file downloads. Browsers typically download (not display) octet-stream files. Prefer specific MIME types when known.
- How do I add MIME types to my server?
- Apache: Add 'AddType' directives to .htaccess or httpd.conf. Nginx: Use 'types' block in nginx.conf. IIS: Configure via IIS Manager or web.config. Node.js/Express: Use mime-types package. Most modern frameworks handle common types automatically.
- What MIME type for JSON?
- application/json is the standard MIME type for JSON. Also acceptable: text/json (less common). When sending JSON APIs, use: Content-Type: application/json; charset=utf-8. JavaScript files use text/javascript (application/javascript is deprecated).