Multipurpose Internet Mail Extensions (MIME) is a standard that extends the format of email messages to support text in character sets other than ASCII, non-text attachments, multi-part message bodies, and header information in non-ASCII character sets. In short, MIME is what lets you send photos, PDFs, videos, and formatted text over email, and it also underpins how web browsers handle file types over HTTP. Before MIME, email could only carry plain ASCII text, so any non-text data had to be manually encoded and decoded by the sender and recipient.
Why MIME Was Created
In the early 1980s, the Simple Mail Transfer Protocol (SMTP) defined email as 7-bit ASCII text with lines no longer than 1000 characters. That worked for plain English messages but failed for almost everything else: accented letters, Cyrillic, Chinese characters, binary files, and even simple formatting. Sending a spreadsheet required a separate encoding step, and the recipient had to know the exact encoding to reverse it.
MIME, defined in 1992 by RFC 1341 and later updated in RFC 2045-2049, solved this by defining a standard way to label and encode content. It introduced the Content-Type header to declare what kind of data is being sent (text, image, audio, etc.) and the Content-Transfer-Encoding header to specify how the data is encoded for safe transport over SMTP. The original RFCs were authored by Nathaniel Borenstein and Ned Freed, and the standard has remained backward-compatible ever since.
How MIME Works
MIME works by adding two key headers to an email message:
- Content-Type: tells the receiving client what the data is. Examples include
text/plain,text/html,image/jpeg,application/pdf. - Content-Transfer-Encoding: tells how the data is encoded. Common values are
7bit(plain ASCII),quoted-printable(mostly ASCII with escaped non-ASCII bytes), andbase64(binary data converted to ASCII).
For attachments, MIME uses a multipart/mixed content type. The message body is split into parts, each with its own Content-Type and Content-Disposition header. The Content-Disposition header can be attachment or inline, and often includes a filename parameter.
For example, an email with a photo attachment looks like this internally:
Content-Type: multipart/mixed; boundary="frontier" --frontier Content-Type: text/plain Hello, see the photo below. --frontier Content-Type: image/jpeg; name="holiday.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="holiday.jpg" /9j/4AAQSkZJRgABAQAAAQABAAD/... (base64 data) --frontier--
Each part is separated by the boundary string, and the final boundary has two trailing hyphens.
MIME Types on the Web
MIME types are not just for email. When your browser requests a file over HTTP, the server sends a Content-Type header that tells the browser what the file is. For instance, an HTML page is text/html, a JPEG image is image/jpeg, and a JavaScript file is application/javascript. The browser uses this header to decide how to render the file, not the file extension alone.
If a server sends the wrong MIME type, the browser may refuse to execute a script or may display a file as plain text. This is why web developers must configure their servers correctly. The IANA (Internet Assigned Numbers Authority) maintains the official registry of MIME types, but new types are added regularly as new file formats appear.
Common MIME Types You Should Know
Here are some of the most frequently encountered MIME types:
text/plain– plain text files (.txt)text/html– HTML documents (.html)text/css– stylesheets (.css)application/javascript– JavaScript files (.js)application/json– JSON data (.json)application/pdf– PDF documents (.pdf)image/png– PNG images (.png)image/jpeg– JPEG images (.jpg, .jpeg)image/gif– GIF images (.gif)audio/mpeg– MP3 audio (.mp3)video/mp4– MP4 video (.mp4)application/zip– ZIP archives (.zip)
Each type is a two-part identifier: a top-level type (text, image, audio, video, application) and a subtype. The subtype can be vendor-specific, like application/vnd.ms-excel for older Excel files.
MIME Encoding: Base64 and Quoted-Printable
Because SMTP was designed for 7-bit ASCII, binary data must be converted to ASCII before sending. Two encoding schemes are used:
- Base64: Converts every 3 bytes of binary data into 4 ASCII characters. It is used for images, videos, and any binary file. Base64 increases file size by about 33%.
- Quoted-Printable: Leaves most ASCII characters as-is, but encodes non-ASCII bytes as an equals sign followed by two hex digits (e.g.,
=E9for é). It is efficient for text that is mostly ASCII, like HTML emails.
Both are reversible, so the receiving client can decode the data back to its original form. The Content-Transfer-Encoding header tells the client which method was used.
MIME Extensions and File Associations
MIME types are often mapped to file extensions by operating systems and email clients. For example, on Windows, the registry maps .jpg to image/jpeg, and on macOS, Launch Services does the same. When you double-click a file, the OS looks up the MIME type to decide which application should open it.
However, the MIME type is just a label; it does not guarantee the file content matches. A file named photo.jpg could actually contain text, and some email clients will still try to open it as an image. This is why security experts recommend not trusting file extensions alone, especially for executable files.
Frequently Asked Questions
What does MIME stand for?
MIME stands for Multipurpose Internet Mail Extensions. It is a standard that extends email to support non-ASCII text, attachments, and multi-part bodies.
Is MIME still used today?
Yes, MIME is still the foundation of email attachments and web content types. Every email with an attachment uses MIME, and every web server sends MIME types with its responses. The standard has been updated but remains fully compatible with the original 1992 version.
What is the difference between MIME and SMTP?
SMTP is the protocol for sending email messages between servers. MIME is a set of headers and encoding rules that define the content of those messages. SMTP transports the message; MIME describes what is inside it.
How do I find the MIME type of a file?
On Linux and macOS, you can use the file --mime-type command. On Windows, you can check the file properties or use a tool like file from Git Bash. Online tools also exist, but they are less reliable for local files.
Can MIME types be spoofed?
Yes, MIME types are just text headers, so a sender can set any value. Email clients and browsers use them as hints, but they also inspect file content and extensions. This is why you should never open an attachment from an unknown sender, even if the MIME type looks safe.
Why do some emails show attachments as “winmail.dat”?
This happens when a Microsoft Outlook user sends email using TNEF (Transport Neutral Encapsulation Format), which is not MIME-compliant. The attachment appears as winmail.dat to non-Outlook clients. The sender should switch to plain MIME format in their email settings to avoid this.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Channel TLD Websites: What They Are & How to Get One5.00 min/km
- Django Class Based Views CRUD REST API
- Most Secure OS for Privacy: 3 Picks by Device
- Ryobi One+ Battery System: Is the Switch Worth It?
- Tmux Terminal Upgrade: Is It Worth It?
- Refurbished Tech Buying Checklist