Skip to content
MtrXTools

MIME decoder

Decode MIME encoded-words in email subjects and names (=?UTF-8?B?…?= and =?ISO-8859-1?Q?…?=) and quoted-printable bodies, or encode text the same way. Runs in your browser.

What it does

  • Decodes RFC 2047 encoded-words such as =?UTF-8?B?w6nDqMOg?= and =?ISO-8859-1?Q?Andr=E9?=, joining adjacent words and dropping the whitespace between them as the RFC requires.
  • Decodes a whole pasted header block (Subject, From, To and folded continuation lines) and shows each header with its decoded value and the charset it used.
  • Decodes RFC 2231 parameters, such as filename*=UTF-8''na%C3%AFve.txt and long names split into filename*0*= and filename*1*= continuations.
  • Decodes quoted-printable bodies (=C3=A9, soft line breaks ending in =) in UTF-8 or a charset you pick.
  • Supports UTF-8, ISO-8859-x, Windows-125x, KOI8-R, Shift_JIS, EUC-JP, ISO-2022-JP, GBK, GB18030, Big5 and EUC-KR.
  • Flags problems: broken base64 inside a word, bad =XX escapes, words longer than 75 characters, unknown charsets and mixed charsets.
  • Encodes text as B or Q encoded-words (UTF-8, split into words of at most 75 characters without breaking a character) or as quoted-printable with 76-character lines.

Why email text looks like =?UTF-8?B?...?=

Email headers were defined for 7-bit ASCII, so a subject or sender name with accents, Cyrillic, Chinese or emoji has to be wrapped in an encoded-word: =?charset?B?base64?= or =?charset?Q?escaped?=. Mail clients decode these for display, but logs, raw message sources, spam reports and scripts show them as they travel. Message bodies use quoted-printable for the same reason, which is where =3D and lines ending in = come from.

If the decoded text looks wrong, the message usually declared one charset and used another. Try the quoted-printable decoder with a different charset, such as Windows-1252 for Western European text.

Questions

What is the difference between B and Q encoding?
B is base64 and suits text that is mostly non-ASCII, such as Chinese or emoji. Q is like quoted-printable: ASCII letters stay readable, spaces become underscores and other bytes become =XX, so it suits mostly-Latin text with a few accents. Both decode to the same text.
Why is the space between two encoded-words removed?
RFC 2047 says whitespace between adjacent encoded-words is not part of the text, so long subjects can be split across several words and folded lines. A space that belongs in the text is encoded inside a word.
What is filename*=UTF-8''...?
That is RFC 2231 parameter encoding, used for attachment names in Content-Disposition and Content-Type. The value is percent-encoded bytes after the charset and an optional language, and long names can be split into numbered parts like filename*0* and filename*1*.
Is my email sent anywhere?
No. Decoding and encoding run in your browser, so headers and message text stay on your machine.