# MIME Type

Key: `representation.file.mime_type`

MIME type (media type) for files and HTTP content (e.g., text/plain, application/json, image/png).

Page: <https://meridian.online/docs/projects/finetype/types/representation/file/mime_type>

Samples: `text/plain`, `application/json`, `image/png`, `text/html; charset=utf-8`, `application/vnd.ms-excel`

## Background

### Origin

RFC 1341, written by N. Borenstein and N. Freed, is dated June 1992.[[1]](https://www.rfc-editor.org/rfc/rfc1341.txt) RFC 1341 introduced a Content-Type header field, generalised from RFC 1049, to specify the type and subtype of data in the body of a message.[[1]](https://www.rfc-editor.org/rfc/rfc1341.txt) RFC 1341 defined an initial set of seven Content-Types.[[1]](https://www.rfc-editor.org/rfc/rfc1341.txt) RFC 2045, dated November 1996, obsoletes RFCs 1521, 1522 and 1590.[[2]](https://www.rfc-editor.org/rfc/rfc2045.txt) RFC 2045 defines the Content-Type value as a type and a subtype separated by a slash, followed by optional semicolon-separated parameters.[[2]](https://www.rfc-editor.org/rfc/rfc2045.txt) RFC 2045 says the initial seven top-level media types are defined in RFC 2046.[[2]](https://www.rfc-editor.org/rfc/rfc2045.txt) RFC 2045 states that a subtype is mandatory and that there are no default subtypes.[[2]](https://www.rfc-editor.org/rfc/rfc2045.txt)

The IANA registry notes that media types were formerly known as MIME types.[[3]](https://www.iana.org/assignments/media-types) Wikipedia lists the registered top-level types as of November 1996 as application, audio, image, message, multipart, text and video.[[4]](https://en.wikipedia.org/wiki/Media_type) RFC 6838, published as BCP 13 in January 2013, sets out how media types are specified and registered.[[5]](https://www.rfc-editor.org/rfc/rfc6838.txt) RFC 6838 formalises structured syntax suffixes such as +xml and +json appended to the base subtype name.[[5]](https://www.rfc-editor.org/rfc/rfc6838.txt)

### Use

HTTP carries media types in its Content-Type and Accept header fields.[[6]](https://www.rfc-editor.org/rfc/rfc9110.txt) RFC 9110 gives text/html;charset=utf-8 and Text/HTML;Charset="utf-8" as equivalent ways of describing UTF-8 HTML.[[6]](https://www.rfc-editor.org/rfc/rfc9110.txt) RFC 9110 says type and subtype tokens are case-insensitive.[[6]](https://www.rfc-editor.org/rfc/rfc9110.txt)

RFC 2046 says the charset parameter values are not case sensitive.[[7]](https://www.rfc-editor.org/rfc/rfc2046.txt) RFC 2046 makes US-ASCII the default character set for text/plain when no charset parameter is given.[[7]](https://www.rfc-editor.org/rfc/rfc2046.txt) RFC 2046 uses the octet-stream subtype for arbitrary binary data.[[7]](https://www.rfc-editor.org/rfc/rfc2046.txt) RFC 9110 says a recipient of a message without Content-Type may assume application/octet-stream or examine the data to determine its type.[[6]](https://www.rfc-editor.org/rfc/rfc9110.txt) Read application/octet-stream in a column as unknown binary rather than as a real description of the file. (Meridian's view)

MDN warns that browsers use the MIME type, not the file extension, to decide how to process a URL.[[8]](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types) RFC 9110 notes that resource owners do not always configure their servers to send the correct Content-Type.[[6]](https://www.rfc-editor.org/rfc/rfc9110.txt) Split a value at the first slash and the first semicolon to get type, subtype and parameters, and keep the full original string alongside. (Meridian's view)

### Where you'll meet it

Common Crawl's index table schema has a content\_mime\_type column holding the Content-Type sent in the HTTP response header.[[9]](https://raw.githubusercontent.com/commoncrawl/cc-index-table/main/src/main/resources/schema/cc-index-schema-flat.json) Common Crawl's index table schema also has a content\_mime\_detected column, a type detected from the content itself.[[9]](https://raw.githubusercontent.com/commoncrawl/cc-index-table/main/src/main/resources/schema/cc-index-schema-flat.json) Common Crawl's cc-index-table repository includes an example query comparing the HTTP Content-Type with the MIME type detected by Tika.[[10]](https://github.com/commoncrawl/cc-index-table)

## Sources

1. [MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies](https://www.rfc-editor.org/rfc/rfc1341.txt) — standard
2. [Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies](https://www.rfc-editor.org/rfc/rfc2045.txt) — standard
3. [Media Types](https://www.iana.org/assignments/media-types) — organisation
4. [Media type - Wikipedia](https://en.wikipedia.org/wiki/Media_type) — secondary source
5. [Media Type Specifications and Registration Procedures](https://www.rfc-editor.org/rfc/rfc6838.txt) — standard
6. [HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.txt) — standard
7. [Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types](https://www.rfc-editor.org/rfc/rfc2046.txt) — standard
8. [Media types (MIME types) - HTTP \| MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types) — secondary source
9. [cc-index-schema-flat.json](https://raw.githubusercontent.com/commoncrawl/cc-index-table/main/src/main/resources/schema/cc-index-schema-flat.json) — dataset
10. [GitHub - commoncrawl/cc-index-table: Index Common Crawl archives in tabular format](https://github.com/commoncrawl/cc-index-table) — organisation
