Internet media type

From Helpful
(Redirected from Mime type)
Jump to navigation Jump to search

Internet Media Type (previously known as MIME type), and sometimes referred to as Content-Type (from the HTTP header it is often seen in) are the type/subtype specification of the type of content.


It is used in

  • HTTP, most typically like Content-Type: text/plain; charset="UTF-8" (note: the charset part is optional but useful)
  • and in various other places


The official list of MIME types is kept by IANA:

http://www.iana.org/assignments/media-types/



x-, vnd-, and such

something/x- are private subtypes

are not registered
(cannot be registered as exactly that. The registered form is often the same without the x-)
in theory everything non-registered should have this. Many but not all follow this.


Similarly, if you think up new type, it should also start with x- (to avoid conflicts with future standard types)


vnd are used when tied to vendor-specific and publicly available products, though that's a bit of a fuzzy distinction.


See also:

On charsets

HTTP and MIME allow the specification of character set on text/ types.

The value should be one registered at:

https://www.iana.org/assignments/character-sets/character-sets.xhtml


Charset names are considered case insensitive (see e.g. RFC 2616 clause 3.4

...though some browsers/UAs have been known to be case sensitive(verify)


See also:

  • RFC 6657


See also


"What's the mime type for..." (some common stuff)

This article/section is a stub — probably a pile of half-sorted notes and is probably a first version, is not well-checked, so may have incorrect bits. (Feel free to ignore, or tell me)

Note that source code is in theory application/ over text/ whenever it settles its own character set (in specs or the document itself), such as in the case of javascript and XML. See also RFC 4329 and this mention


  • CSS
text/css


  • Javascript
often text/javascript in practice
application/javascript in theory (see note above)
Also seen:
application/x-javascript


  • JSON
application/json (see also RFC 4627)
(note: JSONP is Javascript code, not JSON data)


  • XML:
text/xml in practice
application/xml in theory (see note above)


  • JPEG
image/jpeg
You also see:
image/jpg (common mistake, not everything likes this)
image/pjpeg for progressive JPEG - not standard (though apparently acceptable?)
  • PNG
image/png
  • GIF
image/gif


  • PDF:
application/pdf RFC 3778
Also sometimes seen:
application/x-pdf
text/pdf
text/x-pdf



  • MP3
audio/mpeg according to RFC 3003 and HTML5[1]
A web search also shows a dozen others


  • 'arbitrary binary data' (quoth e.g. RFC 2046)
application/octet-stream