What is a MIME encoded header?
E-mail headers were designed in the 1980s for plain ASCII. When a subject, a sender name or an attachment name has an accent, an emoji or a non-Latin letter, the mail program wraps it in an "encoded word" defined by RFC 2047: =?charset?encoding?text?=. For example =?UTF-8?B?T2zDoQ==?= is the word "Olá": UTF-8 is the character set, B means Base64, and the part in the middle is the encoded text. The other form uses Q, a variant of quoted-printable where a space is _ and special bytes are =XX, as in =?ISO-8859-1?Q?Ol=E1?=.
You see these strings every time you open the raw source of a message, a log from a mail server, a bounce, a spam report or a header exported from a ticket system. This tool decodes them into readable text and also does the reverse: type a subject and get a valid header value, choosing Base64 or Q, the character set and whether long values are folded into several lines.
The decoder follows the details that trip up simple scripts. Several encoded words next to each other are joined, and the white space between them is ignored as the standard requires. Words with the same charset are decoded together, so a character whose bytes were split between two words still comes out whole. A subject that was folded over several lines is unfolded first. A table lists each word with its charset, its encoding and whether it decoded cleanly.
The encoder keeps every encoded word within the 75-character limit of RFC 2047 and never cuts a multi-byte character in half. Everything runs in your browser; the text you type is not sent anywhere or stored.
How to decode or encode a header
- Open the page. It starts in Decode mode with a folded subject that contains accents, a dash and an emoji.
- To read a real header, paste the line, with or without the
Subject:name. If it continues on the next lines that start with a space, paste those lines too. - Read the text on the right and check the table underneath. Any word that could not be decoded stays as it was and is marked.
- To write a header, switch to Encode. Type the value or a full
Subject: …line, one per line. - Choose the charset (UTF-8 is the safe default), the encoding (Shortest picks Base64 or Q per value) and whether to fold long values. Then copy the result or download it.
Examples
A Base64 subject
=?UTF-8?B?UmV1bmnDo28gZGUgcGxhbmVqYW1lbnRv?=
Reunião de planejamentoThe B marks Base64 and the bytes are read as UTF-8.
A Q-encoded name in Latin-1
=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
Keld Jørn Simonsen <keld@dkuug.dk>This is the example from the RFC itself. The _ is a space and =F8 is the byte for ø in ISO-8859-1.
A long subject split in two words
Subject: =?UTF-8?B?0JfQtNGA0LDQstGB0YLQstGD0LnRgtC1LCDRjdGC0L4g0YLQtdC8?=
=?UTF-8?B?0LAg0L/QuNGB0YzQvNCwINC90LAg0YDRg9GB0YHQutC+0Lw=?=Long values are split into several words and folded with a line break plus a space. The tool joins them and prints the full Russian sentence.
Encoding a subject
Input Subject: Olá with UTF-8 and Base64 gives Subject: =?utf-8?B?T2zDoQ==?=. Plain ASCII text is not encoded at all, because it does not need to be.
Common mistakes
- Cutting the line in the middle of a word. An encoded word must be whole: it has to start with
=?and end with?=, with exactly four question marks. If a mail client or a copy-paste cut it, decoding fails and the word is left as it was. - Forgetting the folded lines. A subject that continues on the next line starts that line with a space or tab. Paste all the lines, or the end of the subject will be missing.
- Using the wrong charset. If the header says ISO-8859-1 but the bytes are UTF-8, the text comes out with strange pairs such as "á". The table shows the charset the sender declared.
- Spaces inside the word. Q-encoding writes a space as
_. A literal space inside an encoded word breaks it. - Encoding for a charset that lacks the letter. The euro sign is not in ISO-8859-1. The encoder warns you and suggests UTF-8 instead of guessing.
- Expecting Latin-1 to match old tables exactly. Browsers decode
iso-8859-1as windows-1252, which differs only for bytes 0x80 to 0x9F.
Frequently asked questions
What is the difference between B and Q?
Base64 (B) is compact for text that is mostly non-Latin, such as Russian, Japanese or emoji. Q keeps ASCII letters readable and is shorter when only a few characters have accents. The Shortest option compares both for each value.
Why 75 characters?
RFC 2047 limits one encoded word to 75 characters, so that a header line stays within the 78-character convention for mail. Longer values are split into several words on separate lines.
Can I decode a whole e-mail?
This tool decodes the header value or the lines you paste. To read the sender, the received chain and authentication results of a whole header block, use the e-mail header analyzer. For the body of a message encoded in Base64, use the Base64 tool.
Does it also handle quoted-printable in the body?
No. Body parts use a different content transfer encoding. This tool is for header encoded words only. To inspect raw bytes, the hex to text converter helps.
Is my header uploaded?
No. The decoding uses your browser's built-in text decoders and runs locally. The page makes no request and does not store what you type.