File formats

What MIME Is And Why It Outlived the Problem It Solved

A handful of new headers, all of them plain text, all of them safe for a server that had never heard of them. It asked permission from nobody.

9 min read

In 1992 email could carry plain English and nothing else. No attachments, no formatting, no accented characters. MIME fixed that without touching the mail system at all. It added a way for a message to describe its own contents. Everything modern mail does rests on that one idea.

You have met it already if you have ever looked inside a message file. The boundary strings, the Content-Type lines, the blocks of characters where an attachment should be. All of that is MIME. It explains most of what looks strange in the formats mail is stored in.

The Problem It Was Built For

Mail transport was specified for text and the specification meant it. Characters below 128, short lines, nothing that might be mistaken for a control signal.

By the early nineties that was no longer enough. People wanted to send a spreadsheet. They wanted to write in French with the accents intact. They wanted a message that was part text and part something else.

The obvious fix was the one nobody could take. Rewriting the transport would have meant every mail server on earth upgrading at once. A message passes through servers nobody sending it has ever heard of. Whatever solved this had to work while old servers carried on exactly as before.

What MIME Added And What It Left Alone

The solution was to change the message rather than the machinery. A handful of new headers, all of them text, all of them safe for a server that had never heard of them.

RFC 1341 set it out in 1992. It was revised twice. The version in force now is the five document set beginning at RFC 2045, with RFC 2046 covering the type names. The structure has not changed since. What arrives in your inbox today is described the way it was described then, on top of the addressing rules that RFC 5322 still governs.

What MIME Introduced

  • A header naming what the content is
  • A header naming how it was encoded
  • Boundaries dividing one message into parts
  • A way to write headers in other alphabets

What It Deliberately Did Not Touch

  • How a message travels between servers
  • The address format
  • The existing headers, all still valid
  • Anything a 1990 server would choke on
An old server reading a MIME message sees ordinary headers it does not recognise and passes them along untouched, which is exactly what it would do with any header. Nothing had to be upgraded for this to start working.

That restraint is why MIME succeeded where a cleaner design would have failed. It asked permission from nobody.

The Four Headers That Do the Work

Almost everything MIME does runs through a small set of headers. Recognising them makes a raw message readable.

HeaderWhat it settlesTypical value
MIME-VersionThat the message uses MIME at all1.0, unchanged since 1992
Content-TypeWhat this part is, plus which alphabet for texttext/html; charset=utf-8
Content-Transfer-EncodingHow it was converted for the journeybase64, quoted-printable, 7bit, 8bit
Content-DispositionWhether to show it or offer itinline, attachment
Content-IDA label so another part can point at this one<logo@example.net>

Content-Type carries more than a type. For anything textual it also takes a charset parameter naming the character set, which is what tells a reader whether a byte means an accented letter or something else entirely. Get that wrong and the message arrives as symbols, with nothing damaged and nothing missing.

MIME-Version has said 1.0 since 1992. The documents were revised twice while that number stayed put, which tells you the revisions clarified wording rather than changing the format. There has never been a version two. The header survives as a marker that the standard applies rather than as a version number doing any work.

How One Message Becomes Several Parts

A message stops being a single body and becomes a tree.

Content-Type: multipart/mixed; boundary="outer-7f2a"

--outer-7f2a
Content-Type: multipart/alternative; boundary="inner-3c9b"

  --inner-3c9b
  Content-Type: text/plain
    the message, for a reader that wants plain text

  --inner-3c9b
  Content-Type: text/html
    the same message, with formatting

--outer-7f2a
Content-Type: application/pdf; name="invoice.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
    the file, converted into characters

--outer-7f2a--

Two things follow from that shape. The plain text and the HTML are the same message written twice, which is why a message can look completely different in two clients. And the attachment is not beside the message, it is inside it, as another branch of the same tree.

The trailing pair of hyphens closes the message. A boundary line ending in two hyphens means no more parts. Truncate a file before that marker and a reader has no way to know whether it reached the end or the file simply stopped, which is one reason a partly downloaded message often shows nothing at all.

Where the Type Names Come From

Content-Type values are not invented by whoever writes the mail program. They come from a public register.

IANA keeps the list. Anything in it is a media type, which is the name MIME types took once they stopped being about mail. Registration runs through a published procedure rather than by convention. A program meeting a type it does not recognise is expected to treat it as an unnamed lump of bytes rather than guess.

  1. text/ Readable as characterstext/plain and text/html cover most mail. A human could make sense of the raw bytes
  2. image/ audio/ video/ Media, by kindimage/png, audio/mpeg. The top level says what sort of thing, the second half says which format
  3. application/ Everything elseapplication/pdf and application/zip, falling back to application/octet-stream when nothing better fits
  4. multipart/ A container, not contentmultipart/mixed for a message with attachments, multipart/alternative for one message written two ways, multipart/related for HTML with its images travelling alongside
  5. message/ A message inside a messagemessage/rfc822 wraps a whole email as one part. A forwarded message uses it. So does any file that wants a reader to treat its contents as mail
The same register serves the web. A browser deciding whether to display a file or download it is reading a Content-Type from the identical list, which is how a standard written for mail ended up describing half the internet.

What MIME Explains Once You Can See It

Most of the odd behaviour people meet in mail traces back to one of these decisions.

What you seeThe MIME decision behind it
A message full of equals signs and hexQuoted-printable, shown raw by something that could not decode it
An attachment arriving as a wall of lettersBase64, reaching a reader that did not unpack it
A photo shown in the message rather than attachedContent-Disposition said inline, with the HTML referencing its Content-ID
The same message looking different in two clientsmultipart/alternative, with each client choosing a different branch
A subject line of symbols starting with an equals signAn encoded header the client failed to decode
A file arriving with no useful name or iconapplication/octet-stream, the shrug of the type register

None of these is a fault in MIME. Every row is a message describing itself correctly and a program either ignoring the description or being unable to act on it. The standard did its job in all six cases.

Why It Outlived Email

MIME was written for one job and turned out to answer a much more general question, which is how one program hands another a lump of bytes and says what they are.

That question comes up everywhere. A web server answering a request faces it. A saved web page faces it, which is why an MHT file is built on the same container as a message. Outlook faces it when it wraps a message it cannot express in ordinary mail. It calls the result winmail.dat.

A message arriving

In an EML file
Content-Type: image/png
Content-Transfer-Encoding:
  base64
Content-Disposition:
  inline

Written for mail in 1992, describing a picture inside a message.

A web page loading

In an HTTP response
Content-Type: image/png
Content-Disposition:
  attachment

The same headers, the same registry, deciding whether your browser shows the image or downloads it.

Two different jobs, three decades apart, using an identical vocabulary. Neither side had to agree on anything, because the answer to what are these bytes had already been written down.

So MIME is now less a mail standard than a shared vocabulary. The headers in an EML file and the headers in an HTTP response are describing the same thing in the same words, thirty years after somebody wrote them down for a problem about attachments.

Reading a message file and seeing that structure rather than noise is most of the work. Our EML viewer parses it in a browser tab so the parts come out as parts. The converters do the same job when mail has to move somewhere else.

Header behaviour and structure checked against RFC 2045 and the IANA media types registry in August 2026.

Questions People Ask

7 questions, all answered in full on this page.

What does MIME actually stand for?

Multipurpose Internet Mail Extensions. The word extensions is the useful part, because that is exactly what it is. Nothing about mail transport was replaced. A layer was added on top that older software could ignore without breaking.

Is MIME a protocol?

No. The difference matters. A protocol is a conversation between two machines. MIME is a way of describing what is inside a message, so it sits in the content rather than in the exchange. SMTP moves the message. MIME explains what arrived.

Why do I see the word MIME outside email?

Because the problem it solved was never particular to mail. Anything that has to hand over a lump of bytes needs a way to say what those bytes are, so the web borrowed the same header. The registry of types is shared between them.

What is a MIME boundary?

A string of characters chosen by the sending program to mark where one part of a message stops and the next begins. It has to be something that cannot appear in the content, which is why boundaries look like random noise. Longer and stranger means safer.

Does MIME encrypt anything?

No. It describes and it packages. Neither of those hides anything. S/MIME is a separate standard built on top that does add signing and encryption. The similar name causes real confusion. Plain MIME offers no protection at all.

What decides whether something shows inline or as an attachment?

A header called Content-Disposition, which carries a suggestion rather than an instruction. The sending program states a preference and the receiving program decides what to do with it, which is why the same message can look different in two clients.

Do I ever need to think about MIME?

Only when something looks wrong. A message full of equals signs, an attachment that arrives as a wall of characters, a photo that shows as a file rather than in the message. Each of those is a MIME decision that went differently than expected.

Sources

Where the figures and behaviour described above were checked.

  1. MIME Part One, Format of Internet Message Bodies IETF, RFC 2045
  2. MIME Wikipedia
  3. Media Types registry IANA