Developer

What Is a MIME Type? The Content-Type Header, type/subtype, and charset

A MIME type is the mechanism that tells computers exactly "what kind" of data is being exchanged. This article explains what a MIME type is, the role of the Content-Type header, the type/subtype format, the charset parameter for character encoding, browser behavior, how it differs from file extensions, and a list of common MIME types.

Published: 2026-10-16

When you open a web page, the browser correctly decides "this is HTML" or "this is a PNG image" and displays the data the server sent. But how does the browser know the type? The answer is the MIME type (content type). This article explains, step by step, what a MIME type is, where it is used, and what format it has.

What Is a MIME Type

A MIME type (also called a media type or content type) is a short string that indicates the kind of data being exchanged. MIME stands for "Multipurpose Internet Mail Extensions," and it was originally devised to carry non-text data such as images and attachments in email. Today it is used far beyond email, as a common language on the Web (HTTP) for conveying "what kind of data is this."

For example, "text/html" means an HTML document, "image/png" means a PNG image, and "application/json" means JSON data. A computer cannot reliably tell whether bytes are text or an image just by looking at the content. By handing over a label that says "this is an image" or "this is JSON" together with the data, the receiving side can process it correctly. The MIME type plays exactly that role of a "label that shows the content."

When you want to quickly find which MIME type a file corresponds to, the MIME Type Finder makes it easy to check by extension or format.

The Role of the Content-Type Header

On the Web, the MIME type is most active in the Content-Type header. When a browser requests a page from a server, the server returns, in addition to the body data (HTML, an image, and so on), several pieces of accompanying information called HTTP headers. One of them is Content-Type, where "what is this data's MIME type" is written.

Content-Type: text/html; charset=UTF-8

The example above means "this data is HTML, and the character encoding is UTF-8." The browser reads this header, interprets the received data as HTML, and renders it on screen. If the Content-Type were "image/png," it would display it as an image; if "application/pdf," it would open it in a PDF viewer, switching behavior accordingly.

Content-Type is used not only in the response (the server's reply) but also in the request (what the client sends), such as form submissions and sending data to an API. For example, when sending JSON to an API you specify "application/json," and when sending a form that includes files you specify "multipart/form-data." The server reads this header to decide how to interpret the data it receives. A wrong Content-Type causes data to be misinterpreted, leading to garbled text, broken layouts, or API errors. The meaning of the status numbers returned in such HTTP exchanges can be checked with the HTTP Status Codes tool.

The type/subtype Format

A MIME type is always written in a two-level "type/subtype" format separated by a slash. The first part, type, represents the broad category, and the second part, subtype, represents the specific format.

text/html → type is text, subtype is html

The first part, type, roughly includes the following kinds.

  • text: human-readable text. e.g. text/html, text/plain, text/css
  • image: images. e.g. image/png, image/jpeg, image/svg+xml
  • audio / video: audio and video. e.g. audio/mpeg, video/mp4
  • application: other data in general (binary or structured data). e.g. application/json, application/pdf
  • multipart: a combination of multiple pieces of data. e.g. multipart/form-data

Data that cannot be classified is, for the time being, given "application/octet-stream," a MIME type meaning "binary of unknown kind." A browser that receives this generally treats it as a download rather than displaying it. Vendor-specific subtypes prefixed with "vnd." (e.g. application/vnd.ms-excel) are sometimes assigned to proprietary formats as well.

The Meaning of charset (Character Encoding)

For text-based data, a parameter called charset (character set / character encoding) is sometimes attached after the MIME type. This tells the browser "which character encoding should be used to interpret this text."

Content-Type: text/html; charset=UTF-8

By writing "charset=UTF-8" after a semicolon (;), it declares that "this HTML is written in the UTF-8 character encoding." A character encoding is the agreement that maps characters to numbers (byte sequences) on a computer. Even with the same byte sequence, a different character encoding can display entirely different characters.

If the charset is wrong or missing, you get what is called garbled text (mojibake). For example, if a browser mistakenly judges a Japanese page written in UTF-8 to be a different encoding, the intended characters turn into a run of symbols or "?" marks. On today's Web, the standard is to use UTF-8, which can handle characters from around the world and has high compatibility. In HTML you can also specify it with <meta charset="UTF-8">, but because the Content-Type header often takes precedence, it is important to keep it consistent with the server-side setting.

Relationship With Extensions and Browser Behavior

As something that indicates "the kind of file," extensions like .html and .png may feel more familiar. The MIME type and the extension play similar roles, but they work in different places. The extension is part of the file name and is used mainly by the local OS to judge a file, while the MIME type is used to convey the kind of data when exchanging it over a network.

A server usually uses the file extension as a clue to set the corresponding MIME type in Content-Type. For example, it holds a mapping table that assigns text/css to .css files and application/json to .json files. If this setting is wrong, a CSS file may be returned as text/plain, and the browser may not apply it as a style.

What matters here is that the browser ultimately gives priority to the Content-Type (MIME type) when deciding behavior. Even if the extension is .png, if the Content-Type is text/plain, the browser tries to treat it as text rather than an image. Conversely, even without an extension, it is handled properly if the correct MIME type is attached. There is also a behavior called "MIME sniffing," where the browser guesses the content when the MIME type is unreliable, but for security reasons it is increasingly disabled with X-Content-Type-Options: nosniff. When you want to confirm the correct MIME type for a file, the MIME Type Finder is helpful.

A List of Common MIME Types

Finally, here is a summary of representative MIME types that appear frequently in web development. In practice, knowing these will cover most situations.

MIME typeMain contentTypical extension
text/htmlHTML document.html
text/plainPlain text.txt
text/cssStylesheet.css
text/javascriptJavaScript.js
application/jsonJSON data.json
application/pdfPDF document.pdf
application/octet-streamBinary of unknown kind(generic)
image/pngPNG image.png
image/jpegJPEG image.jpg / .jpeg
image/svg+xmlSVG image.svg
audio/mpegMP3 audio.mp3
video/mp4MP4 video.mp4

A MIME type is a foundational technology that attaches a "what is this" label to every piece of data exchanged on the Web, so computers can understand one another correctly. Once you grasp three points - how it is conveyed in the Content-Type header, the type/subtype format, and character encoding via charset - much of garbled text and broken layouts becomes easier to understand. Check which MIME type an actual file maps to with the MIME Type Finder, and the related HTTP response numbers with the HTTP Status Codes tool, deepening your understanding hands-on.

Please note that this article is intended to provide general information. The exact definitions and registration status of MIME types are sometimes updated by standards bodies, so make your decision after checking the latest official specifications and documentation.

FAQ

What is a MIME type?

A MIME type (media type / content type) is a short string that indicates the kind of data being exchanged. "text/html" means an HTML document, "image/png" means a PNG image, and "application/json" means JSON data. It works like a label that shows the content, so the receiving side can process it correctly.

What is the Content-Type header?

Content-Type is the HTTP header that conveys the MIME type of data. It indicates "what kind of data this is" in server responses as well as in form submissions and API requests. For example, "Content-Type: text/html; charset=UTF-8" means HTML with UTF-8 encoding, and the browser reads it to switch how it displays the data.

What does the "type/subtype" notation mean?

A MIME type is always written in two levels separated by a slash. The first part, type, is the broad category (text, image, audio, video, application, multipart, and so on), and the second part, subtype, is the specific format. For example, "image/png" has type image and subtype png, meaning a PNG image.

What happens if charset is not specified?

If the charset (character encoding) is wrong or missing, you may get garbled text, because the same byte sequence displays as different characters under a different encoding. On today's Web the standard is UTF-8, which can handle characters worldwide, and it is important to keep the server and HTML settings consistent.

Can I use the MIME Type Finder for free on a smartphone?

Yes. WAZA TOOLS' MIME Type Finder runs entirely in your browser, so what you enter is never sent to or stored on a server. It works on smartphones too, and you can look up MIME types as many times as you like, for free.