How to use the quoted-printable encoder and decoder
- Choose Encode or Decode.
- To encode, type or paste text. You can switch the input to Hex bytes if you have raw bytes instead of text.
- To decode, paste quoted-printable text. Soft line breaks and escapes such as =C3=A9 are handled for you.
- Read the result, the number of bytes, the length of the encoding and the bytes as hex.
Formula
printable ASCII (33 to 126) except = is written as it is
every other byte is written as = followed by two capital hex digits
a space or tab at the end of a line is encoded
a line is cut with a soft line break (=) so no line is longer than 76 characters
Text is first turned into UTF-8 bytes. A line break in the text stays a line break. A lone carriage return is written as =0D.
Accents, an equals sign and a euro sign
The text Café price = 5€ is 18 bytes in UTF-8. The letter é is the two bytes C3 A9, the equals sign is 3D and the euro sign is the three bytes E2 82 AC. The encoded form is Caf=C3=A9 price =3D 5=E2=82=AC, which is 30 characters, 1.667 characters per byte.
A plain sentence of 137 bytes with no special characters needs only one soft line break, so its encoded length is 139 characters. Decoding Caf=C3=A9 =E2=82=AC5 returns Café €5, 10 bytes in all.
Where quoted-printable is used
Quoted-printable is one of the transfer encodings of email (MIME). It suits text that is mostly ASCII, such as English with a few accented letters, because most characters stay readable and only the exceptions are escaped. For binary data such as images, Base64 is shorter and more common.
You will see it in the source of an email, in lines such as =E2=80=99 for a curly apostrophe. Decoding it by hand is slow, which is what this page does for you.
Limits and related tools
This page works on the body of a message. It does not read mail headers, where a similar but different encoded-word form is used, and it assumes the text is UTF-8. If the text came out garbled, the character set may be wrong, and the Text Encoding Fixer can help. To compare sizes, try the Base64 Encoder and Decoder, and to encode a part of a web address, use the URL Encoder and Decoder.
Assumptions and limits
- Text is read and written as UTF-8.
- Line breaks are written as plain line feeds in the result.
- Soft line breaks are placed so that no line is longer than 76 characters.
- Other character sets and encoded headers are not covered.
- The text shown when the page opens is an example.
Frequently asked questions
Why is the equals sign written as =3D?
The equals sign marks the start of every escape, so a real equals sign must be escaped too. 3D is its code in hex.
What is a soft line break?
It is an equals sign at the very end of a line. It tells the decoder to join the line with the next one, so the text is rebuilt without the break.
Why is a space at the end of a line encoded?
Some mail systems strip spaces and tabs at the ends of lines. Writing them as =20 and =09 keeps them from being lost.
Can decoded bytes that are not text be shown?
Yes. If the bytes are not valid UTF-8 text, the page shows them as hex and says so, instead of showing garbled characters.