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.
Two <source> elements with type attributes which specify the media types.
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>
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.
Media types are specified as type and subtype with a slash (/) between them, like so:
type/subtype
There are nine 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 |
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.
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 |
Media type | Description |
---|---|
audio/mpeg | Mp3 audio format |
audio/ogg | Ogg audio format |
audio/wav | Waveform audio format |
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 |
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 |
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 |
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 |
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 |
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 |
Media type | Description |
---|---|
video/mp4 | Mp4 format |
video/mpeg | Mp3 or other Mpeg format |
video/ogg | A variety of formats inside an Ogg container |
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: