MIME Types: A List of Common Media Types

A MIME type — officially a media type — is a short label such as application/json or image/png that says what format a piece of data is in. HTTP puts it in the Content-Type header so the receiver knows how to read the body. This page lists the ones you are likely to need and explains how to read any other.

Last updated . How this page is checked.

How a MIME type is written

type "/" subtype [ "+" suffix ] [ ";" parameter "=" value ]

application/json
text/html; charset=utf-8
application/problem+json
multipart/form-data; boundary=----x7Tq2

The type is the broad family and the subtype the exact format. Names are not case-sensitive and are conventionally written in lower case. A parameter after a semicolon adds detail: charset on text types, and the required boundary on multipart bodies.

Top-level typeHolds
applicationStructured or binary data meant for a program
textData a person could read as characters
image, audio, video, fontMedia and typefaces
multipartSeveral parts, each with its own type, in one body
message, modelWrapped messages and 3D models; rare in API work

MIME types for API requests and responses

MIME typeUsed for
application/jsonJSON bodies. The default for web APIs.
application/x-www-form-urlencodedHTML form fields as a=1&b=2. Also OAuth token requests.
multipart/form-dataForms that include file uploads.
application/xmlXML meant for programs.
text/xmlXML; the type SOAP 1.1 uses.
application/soap+xmlSOAP 1.2 envelopes. See SOAP vs REST.
application/problem+jsonStandard error bodies defined by RFC 9457.
application/ld+jsonJSON-LD linked data, including schema.org markup.
application/merge-patch+jsonA JSON Merge Patch body for PATCH. See PUT vs PATCH.
application/json-patch+jsonA JSON Patch list of operations for PATCH.
application/jwtA JSON Web Token sent as a body.
application/yamlYAML documents, registered by RFC 9512.
text/event-streamServer-sent events: a response that stays open and streams.
application/x-ndjsonNewline-delimited JSON streams. Widely used, not formally registered.
application/octet-streamArbitrary bytes of no declared format; the fallback for unknown files.

Text, documents and archives

MIME typeTypical extensionUsed for
text/plain.txtUnformatted text
text/html.htmlWeb pages
text/css.cssStylesheets
text/javascript.js, .mjsJavaScript. The registered type; application/javascript is obsolete.
text/csv.csvComma-separated tables
text/markdown.mdMarkdown
application/pdf.pdfPDF documents
application/zip.zipZIP archives
application/gzip.gzGzip-compressed files
application/wasm.wasmWebAssembly modules
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsxExcel workbooks
application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxWord documents

Images, audio, video and fonts

MIME typeTypical extension
image/png.png
image/jpeg.jpg, .jpeg
image/gif.gif
image/webp.webp
image/avif.avif
image/svg+xml.svg
image/x-icon.ico (in common use; the registered name is image/vnd.microsoft.icon)
audio/mpeg.mp3
audio/wav.wav
audio/ogg.ogg, .oga
video/mp4.mp4
video/webm.webm
font/woff2.woff2
font/woff.woff
font/ttf.ttf

Reading a type you have not seen before

Structured suffixes: +json and +xml

A suffix says which general syntax a specialised format is built on. application/problem+json is a specific kind of error document, and it is also JSON, so a client that does not know the specific type can still parse it as JSON. image/svg+xml is an image that happens to be XML. When you meet an unfamiliar type ending in +json, treat the body as JSON and read the provider's documentation for what the fields mean.

Vendor types: vnd.

A subtype beginning vnd. belongs to a particular company or product. APIs use them for versioning: GitHub's API, for example, accepts Accept: application/vnd.github+json. The long Office types in the table above are vendor types too.

The x- prefix

Subtypes starting with x- were never registered. The convention is discouraged for new types, but several old ones are permanent fixtures: application/x-www-form-urlencoded is among the most used media types on the web.

charset

The charset parameter matters on text/* types, where leaving it off invites the receiver to guess and turn accented characters into nonsense. application/json defines no charset parameter, because JSON between systems is always UTF-8. Adding ; charset=utf-8 to it is common and harmless.

Where MIME types appear in HTTP

HeaderSent bySays
Content-TypeWhoever sends a body“This body is in this format.”
AcceptThe client“These are the formats I can read, in order of preference.”

Two status codes exist only for mismatches between them. A server that cannot read the format you sent answers 415 Unsupported Media Type. A server that cannot produce any format your Accept header lists answers 406 Not Acceptable. The Content-Type header guide goes through both headers in detail, and the curl Content-Type example shows how to set them on a command line.

Sniffing, and how to stop it

When a response has a missing or implausible Content-Type, browsers may inspect the bytes and decide the format themselves. That is how a file uploaded as a harmless image can end up executed as a script. Servers prevent it by sending the correct type along with X-Content-Type-Options: nosniff, which tells the browser to believe the header. If you serve files that users uploaded, send both, and serve anything you cannot identify as application/octet-stream so it downloads instead of rendering.

A file extension is a hint for people and operating systems; over HTTP only the header counts. A JSON response served as text/html will be treated as HTML however its URL ends. To see what a server really sends, request the URL in the API tester and read the content-type response header, or use a curl HEAD request.

References

These links leave api-tester.com, which is independent of the organisations they point to.

Frequently asked questions

What is a MIME type?

A label that identifies the format of some data, written as a type and a subtype separated by a slash, such as text/html or application/json. HTTP sends it in the Content-Type header so the receiver knows how to interpret the body.

What does MIME stand for?

Multipurpose Internet Mail Extensions. The labels were invented to describe email attachments and were later adopted by HTTP. The current official name is media type, and the two terms mean the same thing.

What is the MIME type for JSON?

application/json. Specialised JSON formats add a suffix, as in application/problem+json for error details and application/ld+json for linked data.

What is application/octet-stream?

The generic type for binary data of no declared format. Servers use it when they cannot identify a file, and browsers respond by offering to download the content instead of displaying it.

Is a MIME type the same as a file extension?

No. An extension is part of a file name and is only a hint. The MIME type is metadata sent alongside the data, and over HTTP it is the Content-Type header, not the extension in the URL, that decides how the body is handled.

What is the difference between Content-Type and Accept?

Content-Type describes the format of the body in the message that carries it. Accept is sent by a client to list the formats it is willing to receive in the response.