HTTP Media Types

HTTP Media Types is a standard that specifies the nature and format of a file. Browsers rely on media types, rather than file extensions, to know how to handle a file. Media types are formerly known as MIME types.

HTML Reference

Example

Two <source> elements with a type attribute which expect a media type value.
The media types for the video files are: video/mp4 and video/ogg.

<video width="320" height="240" controls>
  <source type="video/mp4" src="/media/movie.mp4">
  <source type="video/ogg" src="/media/movie.ogg">
</video>

Using media types

A media type indicates the format and nature of a document.

Browsers don't look at a link's file extension, but rather what media type it is.

The IANA organization maintains a list of all official media types.

Below are lists of commonly used media types.

Note: Media types are formely know as MIME types.

Commonly used media types

Media types are specified as type and subtype with a slash (/) between them, like so:

 type/subtype

There are eight major top-level types:

Type Description
application Binary data that require an application
audio Audio and music files
font Font and typeface files
image Graphical data formats
message Email and messaging formats
  • application - binary data that require an application
  • -
  • - for or typeface files
  • -
  • -
  • model - model data to create 2d or 3d scenes
  • multipart - data with multiple media types
  • text - readable text files
  • video - video and movie files

Next are commonly used media types organized by type.


Application

#

Media type Description
application/atom+xml Atom feed format
application/octet-stream Any kind of binary file
application/vnd.amazon.ebook Amazon Kindle book format
application/octet-stream Any type of binary file
application/epub+zip Epub book format
application/zip Zip archive format
application/pdf Pdf file format
application/json Json format
application/java-archive Jar format
application/msword Microsoft Word
application/vnd.openxmlformats-officedocument.wordprocessingml.document Microsoft Word (OpenXML)
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format
application/pdf Pdf file format

Audio

#

Media type Description
audio/mpeg Mp3 audio format
audio/ogg Ogg audio format
audio/wav Waveform audio format

Font

#

Media type Description
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font
font/pdf Font

Image

#

Media type Description
image/jpeg Jpeg image
image/png Portable Network Graphics image
image/avif Aliance for Open Media image
image/webp Webp image
image/svg+xml Scalable Vector Graphics (SVG)
image/tiff Tagged Image File Format (TIFF)
image/gif Graphics Interchange Format (GIF)
image/bmp Windows OS/2 Bitmap Graphics

Message

#

Media type Description
message/http Http message
message/partial Email message
message/rfc822 Email subtype with encapsulated message
message/imdn+xml: Imdn message
message/pdf Message
message/pdf Message
message/pdf Message
message/pdf Message
message/pdf Message
message/pdf Message

Model

#

Media type Description
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model
model/pdf Model

Multipart

#

Media type Description
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart
multipart/pdf Multipart

Text

#

Media type Description
text/plain Plain text: ASCII or ISO 8859
text/html HTML format
text/css CSS format
text/javascript JavaScript
text/csv Comma separated values (CSV)
text/pdf Text
text/pdf Text
text/pdf Text
text/pdf Text
text/pdf Text
text/pdf Text
text/pdf Text

Video

#

Media type Description
video/mp4 Mp4 format
video/mpeg Mp3 or other Mpeg format
video/ogg A variety of formats inside an Ogg container

Default media types

Browsers assign a default media type if no type is specified. This process of guessing the right media type is referred to as MIME sniffing. The defaults are:

  • text/plain - for text files (i.e. human readable files), or
  • application/octet-stream - for binary files and files of unknown type

You may also like

Guides