---
id: "mimetype"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["common", "internet"]
langs: ["common"]
aliases: ["mime_type"]
quality: 100
url: "http://registry.apicrafter.io/datatype/mimetype"
---

# Media type (MIME type) (`mimetype`)

Two-part identifier of a data format, type/subtype, such as text/html, image/png or application/vnd.ms-excel, defined by RFC 6838 and registered by IANA. Email (MIME), the HTTP Content-Type header, file metadata and data catalogs use it. The top-level type is one of application, audio, example, font, haptics, image, message, model, multipart, text and video; vendor subtypes start with vnd., personal ones with prs., and unregistered ones often with x-. A value may carry parameters after a semicolon, as in text/html; charset=utf-8. Type names are case-insensitive, but the regexp accepts only the usual lowercase top-level type.

- Personal data (PII): no
- Categories: Common (common), Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier
- Former IDs: `mime_type`

## Detection

Regular expression (Python `re`):

```
^(?:application|audio|example|font|haptics|image|message|model|multipart|text|video)/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}(?:[ \t]*;[ \t]*[A-Za-z0-9!#$%&'*+.^_`|~-]+=(?:[A-Za-z0-9!#$%&'*+.^_`|~-]+|"[^"]*"))*$
```

## Examples

- `text/html` — HyperText Markup Language
- `image/jpeg` — JPEG image
- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` — Excel workbook (XLSX), a vendor subtype
- `text/html; charset=utf-8` — Content-Type value with a parameter
- `html` (invalid example) — No subtype
- `text/` (invalid example) — Empty subtype

## Mappings

- schema_org: `encodingFormat`
- wikidata: `P1163`

## Metacrafter rules

3 rules: 2 match the field name, 1 match values.

- `mimetypebyknown` (field, `common/common.yaml`)
- `mimetypebyknown1` (field, `common/common.yaml`)
- `mimetypebyvalue` (data, `common/common.yaml`)

## Supported by tools

- `greatexpectations`
- `metacrafter`

## Translations

- ru: Тип медиа (MIME-тип): Идентификатор формата данных вида тип/подтип, например text/html (RFC 6838).

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Media_type>
- wikidata: <https://www.wikidata.org/wiki/Property:P1163>
- doc: <https://www.rfc-editor.org/rfc/rfc6838>
- doc: <https://www.iana.org/assignments/media-types/media-types.xhtml>

## Quality

Score 100/100.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/mimetype.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/mimetype.yaml>
