Email Subject Decoder (=?UTF-8?B?…?=)|Turn encoded subject lines and attachment names back into text
A subject like =?UTF-8?B?SW52b2ljZSAjMjAyNi0xMTgg4oCTIGZpbmFs?= is not corrupted. It is an RFC 2047 encoded-word, and it reads "Invoice #2026-118 – final". Paste one here, or a whole header block from a raw message, a log, a CSV export or a ticket, and you get the readable text back.
💡 About this tool
Encoded-words are how non-ASCII text travels in email headers. The shape is always =?charset?encoding?text?=. The charset names how the bytes are meant to be read, and the encoding letter is B (Base64) or Q (a quoted-printable variant). You see them raw when a program shows the header as stored, without decoding it.
What the tool does with what you paste:
- Decoded text: every
=?…?=in the input is replaced by its text. Everything around it, such asSubject:orRe:, stays as it was - What was decoded: one row per decoded piece, with its form (B or Q), its character set and the original string next to the result
- Attachment names: RFC 2231 values such as
filename*=UTF-8''r%C3%A9sum%C3%A9.pdf, split values (filename*0*=,filename*1*=) and thename="=?UTF-8?B?…?="style are all decoded - Folded headers: lines that continue on the next line with a leading space are joined first
Any character set the browser can read works: UTF-8, ISO-8859-1, Windows-1252, ISO-2022-JP, Shift_JIS and more. If a piece names a character set the browser does not know, or its Base64 is damaged, that piece is left untouched and a note under the box says why.
🧐 Frequently Asked Questions
Q. What does =?UTF-8?Q?…?= mean, compared with ?B??
Both carry the same kind of text. With B, the bytes are Base64. With Q, ordinary letters stay readable and other bytes are written as = plus two hex digits, so Pr=C3=A9sentation is "Présentation". In Q, an underscore stands for a space. RFC 2047 says the encoding letter and the charset name are case-independent, so ?b? and ?q? work too.
Q. My subject is split into several =?…?= pieces with spaces between them. Is that a problem?
No. RFC 2047 limits one encoded-word to 75 characters, so long subjects are cut into several pieces. Section 6.2 says the white space between two adjacent encoded-words is ignored, and this tool joins them the same way. Pieces in the same character set are decoded together, so a character whose bytes were split across two pieces still comes out whole.
Q. Why do I get "�" in the result?
The bytes did not fit the character set the piece declares. Either the sender labelled the text with the wrong charset, or the string was cut off when it was copied. Make sure the copy runs to the closing ?=.
Q. What is filename*=UTF-8''…?
It is the RFC 2231 way of putting non-ASCII text in a parameter value. The part before the first quote is the charset, the part between the two quotes is an optional language tag, and the rest uses % plus two hex digits for each byte. Long names may be split into numbered pieces, which the tool puts back together in order.
Q. Can it fix text like "résumé" or "don’t"?
No. That is a different failure: text that was decoded with the wrong character set and is now made of real characters. This tool only reads =?…?= and filename*= forms, and it says so when it finds neither.
📚 The rule the attachment names broke
RFC 2047, published in November 1996, says an encoded-word "MUST NOT appear within a quoted-string" and must not be used in a parameter of a Content-Type or Content-Disposition field. In other words, filename="=?UTF-8?B?…?=" is outside the rules. RFC 2231, a year later, added the filename*=charset'language'%XX form for exactly that job, and it can also mark the language of an encoded-word, as in =?US-ASCII*EN?Q?Keith_Moore?=.
If you are writing a parser, that is the reason to handle both: the standard form for parameters, and the encoded-word form in case it turns up in a parameter. This tool reads both, plus the language suffix.