Decode Quoted Printable

Decode Quoted-Printable text. Free QP decoder.

Decode as

Looking for the other direction? Encode Quoted Printable

Rate this tool

How useful was this tool?

Decode Quoted Printable

Paste Quoted-Printable into Quoted-Printable text, or load the Example, and the readable text appears under Decoded text. Choose what you’re decoding under Decode as:

  • A message body (RFC 2045): =XX sequences and soft line breaks.
  • A header with encoded-words (RFC 2047): =?charset?Q?...?= and =?charset?B?...?=, as in a Subject or a sender’s name.

Charset decides how the decoded bytes are read as text:

  • Auto (UTF-8, Windows-1252 for anything else)
  • UTF-8 only
  • Windows-1252 (Latin-1)

A summary counts what was decoded, and anything that couldn’t be decoded is listed. Copy takes the result, and Clear starts over.

Example

The Example is the encoded text from Encode Quoted Printable:

CommandCopy
Hello, =3D world! Caf=C3=A9, na=C3=AFve fa=C3=A7ade, 100 =E2=82=AC and stra=
=C3=9Fe. Trailing space here:=20
A long line to show the soft line break at 76 characters: the quick brown f=
ox jumps over the lazy dog again and again.

decodes back to the original:

Hello, = world! Café, naïve façade, 100 € and straße. Trailing space here: 
A long line to show the soft line break at 76 characters: the quick brown fox jumps over the lazy dog again and again.

The summary reads 13 =XX sequences decoded, 2 soft line breaks removed, 200 bytes read as UTF-8 (Windows-1252 for invalid bytes): 194 characters.

The two soft breaks, the = at the end of “stra=” and “brown f=”, are gone. “straße” and “fox” are whole again. The =20 at the end of the second line came back as a real trailing space.

How decoding works

The tool follows the RFC 2045 rules:

  1. Every =XX becomes the byte XX. =3D is =, =20 is a space, and =C3=A9 is the two bytes of é in UTF-8.
  2. An = at the very end of a line is a soft line break and is removed, joining the line to the next.
  3. Spaces or tabs at the end of a line are dropped. They may have been added along the way, and a space that’s really meant to be there was encoded as =20.
  4. The bytes are then read as text in the chosen charset.

That last step is where most trouble starts.

Choosing the charset

Quoted-Printable only stores bytes. Which characters they stand for depends on the charset the sender used, named in the message’s Content-Type header, for example charset=UTF-8 or charset=windows-1252.

Auto handles both common cases. It reads the bytes as UTF-8, and any byte that isn’t valid UTF-8 as Windows-1252, so an older message decodes correctly too. Gr=FC=DFe, written in Windows-1252, comes out as “Grüße”.

Choose by hand to see what happens with the wrong one. Gr=C3=BC=C3=9Fe is “Grüße” in UTF-8. Read as Windows-1252, it becomes “Grüße”: each UTF-8 byte is shown as a separate character. That’s the familiar garbage in old emails, and now you know where it comes from. UTF-8 only is useful when you want invalid bytes to show up as errors rather than be quietly read as Windows-1252.

Damaged messages

Emails get mangled on the way: a mail client rewraps the lines, a reply adds > at the start of each line, part of a message is copied out of a log, or a forward breaks the soft line breaks.

The decoder doesn’t give up on any of that. A broken sequence, such as an = followed by something that isn’t two hex digits, is kept exactly as written and listed, and everything around it is decoded normally. So a damaged message still decodes as far as it can, and the list shows exactly where the damage is.

If the text contains =?...?= encoded-words, it’s a header, and the note suggests switching to header mode.

Decoding headers

Subject lines and display names with accents arrive as encoded-words. In header mode, they’re decoded and the plain text around them is kept:

Header text Decoded
=?UTF-8?Q?Caf=C3=A9_offer_for_100_=E2=82=AC?= Café offer for 100 €
=?UTF-8?B?Q2Fmw6kgb2ZmZXIgZm9yIDEwMCDigqw=?= Café offer for 100 €
=?ISO-8859-1?Q?Gr=FC=DFe_aus_M=FCnchen?= Grüße aus München
Re: =?UTF-8?Q?Caf=C3=A9?= menu Re: Café menu

A few rules explain these results:

  • Q encoding works like the body version, but a space is written as _.
  • B encoding is Base64 inside the same =?…?= wrapper.
  • Each encoded-word names its own charset, so a header can mix them.
  • Long subjects are split into several encoded-words. The space between two encoded-words is ignored, so =?UTF-8?Q?Caf=C3=A9?= =?UTF-8?Q?_offer?= reads “Café offer”, not “Café offer”.

To read a full header block, with the Received lines, authentication results and dates, use the Email Header Decoder.

Where you’ll find Quoted-Printable

  • The raw source of an email, under “Show original” in Gmail or “View source” in other mail programs. Look for Content-Transfer-Encoding: quoted-printable above the text.
  • Saved .eml and mbox files, which store messages exactly as they were sent.
  • HTML email source copied from a sending platform or a raw message, full of href=3D"…" and style=3D"…". Decoded, <a href=3D"https://example.com/"> becomes <a href="https://example.com/">.
  • Forwarded or quoted messages where something along the way showed the encoded text instead of decoding it, leaving =20 at line ends and =E2=80=99 where apostrophes should be.

FAQ

Why does my email show =20, =3D or =C3=A9?

The message wasn’t decoded before you saw it. Usually its Content-Transfer-Encoding header was lost or damaged, often in a forward or an export, or you’re looking at the raw source. Paste the text here, and choose header mode for a Subject line.

Why is the decoded text still garbled?

The charset doesn’t match. Text with “é” or “€” is UTF-8 read as Windows-1252: choose Auto or UTF-8 only. Text with � in place of accents is probably Windows-1252 read as UTF-8: choose Windows-1252.

Is Quoted-Printable a kind of encryption?

No. It only makes text safe to pass through mail systems built for plain ASCII. Anyone can decode it, as this page shows.

How do I decode it in code?

  • Python: quopri.decodestring(data).decode('utf-8') for a body. For a header, str(email.header.make_header(email.header.decode_header(subject))).
  • PHP: quoted_printable_decode($body) for a body, and iconv_mime_decode($subject, 0, 'UTF-8') for a header.

Note: All processing is done client-side. We do not store or see your data.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us