knowledge/technology/files/MIME.md
2024-03-06 13:18:37 +01:00

18 KiB

obj
concept

MIME Type

A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were originally defined in Request for Comments RFC 2045 (MIME) Part One: Format of Internet Message Bodies (Nov 1996) in November 1996 as a part of MIME (Multipurpose Internet Mail Extensions) specification, for denoting type of email message content and attachments; hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP and document file formats such as HTML, for similar purposes.

A list of supported MIME Types can be found at /etc/mime.types

Naming

A media type consists of a type and a subtype, which is further structured into a tree. A media type can optionally define a suffix and parameters:
type "/" [tree "."] subtype ["+" suffix]* [";" parameter]
As of November 1996, the registered types were: application, audio, image, message, multipart, text and video. By December 2020, the registered types included the foregoing, plus font, example, and model.

An unofficial top-level name in common use is chemical.

As an example, an HTML file might be designated text/html; charset=UTF-8. In this example, text is the type, html is the subtype, and charset=UTF-8 is an optional parameter indicating the character encoding.

A subtype typically consists of a media format, but it may or must also contain other content, such as a tree prefix, producer, product or suffix, according to the different rules in registration trees.

Types, subtypes, and parameter names are case-insensitive. Parameter values are usually case-sensitive, but may be interpreted in a case-insensitive fashion depending on the intended use.

Common MIME Types Files

Application

MIME Type Extensions Description
application/epub+zip .epub Electronic Publication (eBook)
application/keepass .kdbx KeePassXC File
application/desktop .desktop Linux Desktop Entry
application/vnd.rar .rar RAR Archive
application/blender .blend Blender File
application/x-7z-compressed .7z 7z Archive
application/x-x509-ca-cert .crt, .der Certificate
application/octet-stream .a, .bin, .dump, .o, .obj, .pkg, .so Binary Data
application/octet-stream .qcow2 QEMU Image
application/xspf+xml .xspf XML Shareable Playlist Format
application/vnd.comicbook+zip .cbz Comic Book Archive
application/vnd.android.package-archive .apk Android Package
application/msword .doc Word Document
application/pgp-signature .asc, .sig PGP Signature
application/rss+xml .rss, .xml RSS Feed
application/vnd.ms-excel .xls Excel Document
application/vnd.ms-powerpoint .ppt PowerPoint Document
application/vnd.oasis.opendocument.presentation .odp Presentation
application/vnd.oasis.opendocument.spreadsheet .ods Spreadsheet
application/vnd.oasis.opendocument.text .odt Text Document
application/vnd.microsoft.portable-executable .exe Windows Executable
application/vnd.sqlite3 .db,.sqlite, .sqlite3 SQLite Database
application/x-iso9660-image .iso, .isoimg, .cdr ISO Images
application/http - HTTP
application/javascript .js Javascript
application/json .json JSON Data
application/pdf .pdf PDF Document
application/pem-certificate-chain .pem Certificates
application/pgp-encrypted .pgp PGP Data
application/pgp-keys .asc, .pub PGP Keys
application/pgp-signature .sig PGP Signatures
application/sql .sql SQL Databases
application/wasm .wasm WebAssembly
application/xml .xml XML
application/zip .zip ZIP Files
application/zstd .zst Zstd Compression
application/bittorrent .torrent Torrent
application/java-archive .jar Java
application/latex .latex LATeX
application/rpm .rpm Fedora Package
application/sh .sh Shell
application/tar .tar TAR
application/xz .xz XZ Compression
application/msgpack .mpk, .msgpack MessagePack
application/toml .toml TOML
application/yaml .yaml, .yml YAML

Audio

MIME Type Extensions Description
audio/aac .adts, .aac AAC Audio
audio/mp4 .m4a AAC MP4
audio/mpeg .mp3 -
audio/ogg .oga, .ogg Ogg
audio/opus .opus Opus
audio/vorbis .ogg Vorbis
audio/midi .mid, .midi MIDI
audio/aiff .aif, .aiff AIFF
audio/flac .flac FLAC
audio/matroska .mka Matroska Audio
audio/wav .wav WAV
audio/x-mpegurl .m3u, .m3u8 Playlist File

Font

MIME Type Extensions Description
font/ttf .ttf TrueType Font
font/otf .otf OpenType Font
font/woff .woff Web Open Font Format

Image

MIME Type Extensions Description
image/heif .heif HEIF Image
image/avif .avif AVIF Image
image/bmp .bmp BMP Image
image/gif .gif GIF Image
image/jpeg .jpg, .jpeg JPEG Image
image/jxl .jxl JPEG XL
image/png .png PNG Image
image/svg+xml .svg Scalable Vector Graphics Image
image/tiff .tiff, .tif TIFF Image
image/webp .webp WebP Image
image/qoi .qoi QOI Format
image/x-xcf .xcf XCF Image (GIMP)

Message

MIME Type Extensions Description
message/delivery-status - -
message/http - -
message/partial .part Partial File
message/rfc822 .eml eMail Message

Model

MIME Type Extensions Description
model/mesh .msh, .mesh, .silo 3D Mesh
model/obj .obj 3D Object

Multipart

MIME Type Extensions Description
multipart/digest - -
multipart/encrypted - -
multipart/form-data - -
multipart/parallel - -

Text

MIME Type Extensions Description
text/calendar .ics Calendar
text/vcard .vcf Contact File
text/css .css CSS Stylesheets
text/csv .csv CSV Data
text/directory - -
text/html .html, .htm HTML Data
text/markdown .markdown, .md Markdown
text/plain .txt, .text, .conf Plain Text
text/plain .asc ASCII (Armored) File
text/plain .log Log Files
text/plain .diff Diff File (diff / patch)
text/plain .lrc LRC (Lyrics) File
text/plain .nfo Information File
text/plain .srt SubRip Subtitle
text/plain .ass ASS (Advanced SubStation Alpha) Subtitle
text/c .c, .cc, .cpp, .cxx, .dic, .h, .hh C Source File
text/rust .rs Rust Source File
text/python .py Python File
text/uri-list .uri, .uris, .urls List with URLs

Video

MIME Type Extensions Description
video/AV1 - AV1
video/H264 - H.264
video/H265 - H.265
video/webm - VP9
video/mp4 .mp4, .m4a MP4 Video
video/quicktime .mov, .qt Quicktime
video/webm .webm WebM Video
video/matroska .mkv Matroska