- Home
- Tools
- Encoding & Decoding
- Quoted-Printable Encoder/Decoder
Quoted-Printable Encoder/Decoder
Decode the =C3=A9 codes and soft line breaks you find in the raw source of an e-mail, or encode text the same way.
Only need one direction? Quoted-Printable Encode and Quoted-Printable Decode have their own pages.
Quoted-printable
E-mail was designed for 7-bit ASCII text. Quoted-printable is the trick that lets a message carry anything else: every byte that isn't a plain printable ASCII character is written as an equals sign followed by two hex digits. The é in "café" is the bytes C3 A9 in UTF-8, so it travels as caf=C3=A9.
You run into it when you open the raw source of an e-mail and find text that is mostly readable, but sprinkled with =E2=80=99 and lines that end in a lone =.
The rules
- Printable ASCII characters stand for themselves, except the equals sign, which becomes
=3D. - Any other byte becomes
=XX, where XX is its value in upper-case hex. - A line may be at most 76 characters long. Longer lines are cut with a soft line break: a
=at the very end of the line, which the decoder removes again together with the line break. - A space or tab at the end of a line is encoded as
=20or=09, because mail servers like to strip trailing whitespace.
Quoted-printable or Base64
Quoted-printable keeps mostly-English text readable and adds little overhead. For text in other scripts, or for attachments, nearly every byte would need three characters, and Base64 with its fixed overhead of a third is the better choice. Mail programs pick between the two on their own.
This tool assumes the text is UTF-8, which is what nearly all e-mail uses today. A message that declares an older character set such as ISO-8859-1 or Windows-1252 will come out with the wrong accented letters.