Internet media types
Internet media types, formerly known as "MIME types" or "Content-types", is a standard designed to indicate the type of information a file or piece of data contains. In
HTML, this identifier can be useful for knowing the type of a file before downloading and being able to access it. It's a good practice to provide media type information whenever possible, like in the case of elements having attributes like type
, enctype
, formenctype
and accept
.
Every Internet media types identifier must comply with the following format:
[type]/[tree.][subtype][+suffix][;parameters]
As you may have already noted, the "type" and "subtype" must be present in any Internet media type. In the following list are some examples containing each of the parts outlined before.
image/png
application/rss+xml
video/mp4; codecs="avc1.640028"
application/vnd.google-earth.kmz
Commont internet media types
Currently, there are nine top-level types, which are: "application", "audio", "example", "image", "message", "model", "multipart", "text" and "video". The following section provides some of the most popular media types used in web applications.
Type application
- application/atom+xml: Atom feeds format.
- application/vnd.dart: Dart file format.
- application/ecmascript:
ECMAScript/JavaScript data (equivalent to application/javascript but with stricter processing rules).
- application/EDI-X12:
EDI X12 data.
- application/EDIFACT:
EDI
EDIFACT data.
- application/json:
JSON data.
- application/javascript:
ECMAScript/JavaScript data (equivalent to application/ecmascript but with looser processing rules).
- application/octet-stream: Arbitrary binary data.
- application/ogg: Ogg, a multimedia bitstream container format.
- application/dash+xml:
MPEG-DASH, a multimedia streaming standard.
- application/pdf:
PDF, a document exchange format.
- application/postscript: PostScript format.
- application/rdf+xml:
RDF format.
- application/rss+xml:
RSS feeds format.
- application/soap+xml:
SOAP format.
- application/font-woff:
WOFF (candidate recommendation; use application/x-font-woff until standard is official).
- application/xhtml+xml:
XHTML format.
- application/xml:
XML format.
- application/xml-dtd:
DTD format.
- application/xop+xml:
XOP data.
- application/zip: ZIP compressed format.
- application/gzip: Gzip compressed format.
- application/smil+xml:
SMIL format.
- application/vnd.android.package-archive:
APK files.
- application/vnd.debian.binary-package: DEB file format.
- application/vnd.google-earth.kml+xml:
KML files.
- application/vnd.google-earth.kmz:
KMZ files.
- application/vnd.mozilla.xul+xml:
XUL files.
- application/vnd.ms-excel: Microsoft Excel files.
- application/vnd.ms-powerpoint: Microsoft Powerpoint files.
- application/vnd.ms-xpsdocument:
XPS.
- application/vnd.oasis.opendocument.text: OpenDocument Text.
- application/vnd.oasis.opendocument.spreadsheet: OpenDocument Spreadsheet.
- application/vnd.oasis.opendocument.presentation: OpenDocument Presentation.
- application/vnd.oasis.opendocument.graphics: OpenDocument Graphics.
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: Microsoft Excel 2007.
- application/vnd.openxmlformats-officedocument.presentationml.presentation: Microsoft Powerpoint 2007.
- application/vnd.openxmlformats-officedocument.wordprocessingml.document: Microsoft Word 2007.
- application/x-7z-compressed: 7-Zip compression format.
- application/x-chrome-extension: Google Chrome/Chrome OS extension, app or theme package.
- application/x-dvi: Device-independent document in
DVI format.
- application/x-font-ttf:
TTF format TrueType Font (unofficial but widely used).
- application/x-javascript.
- application/x-latex:
LaTeX format.
- application/x-mpegURL: .m3u8 variant playlist.
- application/x-rar-compressed:
RAR format.
- application/x-shockwave-flash: Adobe Flash format.
- application/x-stuffit: StuffIt archive format.
- application/x-tar: Tarball format.
- application/x-www-form-urlencoded: form encoded data.
- application/x-xpinstall: Add-ons to Mozilla applications.
- application/x-nacl: Native Client web module (supplied via Google Web Store only).
- application/x-pnacl: Portable Native Client web module (may be supplied by any website as it is safer than x-nacl)
- application/x-pkcs12: a variant of
PKCS files.
Type audio
- audio/basic: μ-law format, at 8 kHz, 1 channel.
- audio/L24: 24bit Linear
PCM format, at 8–48 kHz, 1-N channels.
- audio/mp4:
MP4 format.
- audio/mpeg:
MP3 or other
MPEG format.
- audio/ogg: Vorbis, Opus, Speex,
FLAC and other formats in an Ogg container.
- audio/flac: native
FLAC format (FLAC in its own container).
- audio/opus: Opus streamed format.
- audio/vorbis: Vorbis streamed format.
- audio/vnd.rn-realaudio: RealAudio format.
- audio/vnd.wave:
WAV format.
- audio/webm: WebM open media format.
- audio/x-aac:
AAC format.
- audio/x-caf: Apple's
CAF audio files.
Type image
- image/gif:
GIF format.
- image/jpeg:
JPEG
JFIF format.
- image/pjpeg:
JPEG
JFIF format (for progressive
JPEG, used before global browser support).
- image/png:
PNG format.
- image/bmp:
BMP format.
- image/svg+xml:
SVG vector format.
- image/tiff:
TIFF image;
- image/vnd.djvu: DjVu image and multipage document format.
- image/x-xcf:
XCF,
GIMP's file format.
Type message
- message/http:
HTTP message.
- message/imdn+xml:
IMDN message.
- message/partial: e-mail message.
- message/rfc822: e-mail message (EML files,
MIME,
MHT,
MHTML).
Type model
- model/iges: IGS and
IGES files.
- model/mesh: MSH and MESH files.
- model/vrml:
WRL and
VRML files.
- model/x3d+binary: X3D
ISO standard for representing 3D computer graphics, X3DB binary files (not official but still used).
- model/x3d+fastinfoset: X3D
ISO standard for representing 3D computer graphics, X3DB binary files (not yet official, replaces any use of model/x3d+binary).
- model/x3d-vrml: X3D
ISO standard for representing 3D computer graphics, X3DV
VRML files (not yet official, previously known as model/x3d+vrml)
- model/x3d+xml: X3D
ISO standard for representing 3D computer graphics, X3D
XML files.
Type multipart
- multipart/mixed:
MIME email.
- multipart/alternative:
MIME email.
- multipart/related:
MIME email (used by
MHTML).
- multipart/form-data:
MIME webform.
- multipart/signed:
MIME security.
- multipart/encrypted:
MIME security.
Type text
- text/cmd: commands.
- text/css:
CSS.
- text/csv:
CSV.
- text/html:
HTML.
- text/markdown: Markdown.
- text/javascript: JavaScript (made obsolete in favor of application/javascript, but better supported).
- text/plain: Textual data.
- text/rtf:
RTF.
- text/vcard: vCard (contact information).
- text/vnd.a: The A language framework.
- text/vnd.abc: ABC music notation.
- text/xml:
XML.
- text/x-gwt-rpc: GoogleWebToolkit data.
- text/x-jquery-tmpl: jQuery template data.
Type video
- video/avi: Covers most Windows-compatible formats including .avi and .divx.
- video/mpeg:
MPEG-1 video with multiplexed audio.
- video/mp4:
MP4 video.
- video/ogg: Ogg Theora or other video (with audio).
- video/quicktime: QuickTime video.
- video/webm: WebM Matroska-based open media format.
- video/x-matroska: Matroska open media format.
- video/x-ms-wmv:
WMV format.
- video/x-flv:
FLV format.