Quoted-Printable Encoder / Decoder

Encode and decode MIME Quoted-Printable.

Open tool

Overview

The Quoted-Printable encoder and decoder converts between raw text and the MIME quoted-printable encoding used in email bodies and email headers. Paste text with non-ASCII characters or long lines and get back a 7-bit-safe stream; paste an encoded line from an email source and get back the original bytes.

It is the right tool when you are reading a raw email from View Source, decoding an =?UTF-8?Q?...?= mail header, or stripping = line continuations from a hand-edited message. A quoted-printable decoder is also useful for forensics — phishing emails often hide payloads in soft-wrapped QP bodies that look like noise until decoded.

How it works

Quoted-Printable, defined in RFC 2045 §6.7, is one of the two standard content-transfer-encodings for MIME (the other is Base64). Printable ASCII characters pass through as themselves, except for = which always becomes =3D. Non-printable, 8-bit, or otherwise unsafe bytes are written as =XX, where XX is the uppercase hex value. Lines must be at most 76 characters; longer lines are split with a "soft line break" — a trailing = followed by CRLF, which the decoder strips. Trailing whitespace on a line must also be escaped (=20 for space, =09 for tab) because mail transports may strip it.

The header variant (RFC 2047 "Q" encoding) uses _ for space and applies inside =?charset?Q?...?= tokens.

Examples

Input:  "Schöne Grüße"
Output: Sch=C3=B6ne Gr=C3=BC=C3=9Fe
Input:  A very long line that needs to be soft-wrapped because it goes past seventy-six columns and so on...
Output: A very long line that needs to be soft-wrapped because it goes past seventy=
        -six columns and so on...
Encoded: Sch=C3=B6ne=20Gr=C3=BC=C3=9Fe
Output:  Schöne Grüße
Header form: =?UTF-8?Q?Sch=C3=B6ne_Gr=C3=BC=C3=9Fe?=
Decoded:     Schöne Grüße

FAQ

When does email use QP vs Base64?

QP for mostly-ASCII text with occasional 8-bit characters — keeps the source readable. Base64 for binary attachments and text that is mostly non-ASCII (where QP would balloon the size). Both are equivalent in carrying capacity; the choice is cosmetic and historical.

Why does my decoded text have ?= at the end?

You are probably looking at a header-form encoded-word, not a body encoding. Strip the =?charset?Q? prefix and the ?= suffix, then run the rest through the decoder. The tool detects the header form automatically.

Are soft line breaks the same as actual newlines?

No. A soft line break (=\r\n) means "this line continues — do not add a newline". A hard newline in the source represents an actual newline in the decoded output.

Why is = encoded as =3D instead of staying as itself?

Because = is the escape character. If it were left literal, the decoder could not tell whether it introduced an escape or stood for itself.

Try Quoted-Printable Encoder / Decoder

An unhandled error has occurred. Reload ×