How to use it
- Choose Encode or Decode.
- Paste the text. For decoding, paste only the body part that has Content-Transfer-Encoding: quoted-printable, not the headers.
- When decoding old emails, pick the charset named in the Content-Type header.
- Copy the result.
How it works
Encoding (RFC 2045, section 6.7):
- The text is turned into UTF-8 bytes.
- Bytes 33–126 except = are written as they are; = becomes =3D; any other byte becomes =XX in upper-case hex.
- A space or tab stays, unless it is the last character of a line.
- Line breaks of the text are kept. A line longer than 76 characters is cut with a soft break: at most 75 characters plus =. An =XX group is never split.
Decoding removes trailing spaces of each line, joins lines that end with =, turns each =XX into a byte and reads the bytes in the chosen charset.
Worked example
Café = 5€ is encoded as Caf=C3=A9 =3D 5=E2=82=AC:
- é is two bytes in UTF-8, C3 A9;
- = becomes =3D, so the decoder will not read it as an escape;
- € is three bytes, E2 82 AC;
- the spaces stay as they are.
Decoding Caf=C3=A9 au= followed by a line lait gives Café au lait: the = at the end of the first line is a soft break.
Tips
- Seeing =E2=80=99 or =C2=A0 in an email? Those are UTF-8 for a curly apostrophe and a no-break space.
- Mail protocols use CRLF line ends; this tool works with plain line breaks, and mail software adds the CR itself.
- For attachments and binary data, email uses Base64 instead: see the Base64 encoder.