quoted-printable-encoder
Quoted-printable (QP) is a MIME encoding (RFC 2045) that represents 8-bit data using only printable ASCII β necessary in email systems where some intermediaries still cannot reliably handle 8-bit content β by escaping non-printable and special bytes as =NN (where NN is the byte's hex value) and breaking long lines. The ZTools Quoted-Printable Encoder handles both encoding and decoding, supports the soft-line-break rules (lines β€ 76 chars with = continuation), preserves UTF-8 multi-byte characters correctly, and is the right tool for inspecting raw email source or producing safe email-body content.
Use casesβ
Reading raw email sourceβ
Email clients show "Content-Transfer-Encoding: quoted-printable" with =E2=82=AC scattered through the body. Decode to read the original Unicode message.
Composing email programmaticallyβ
A custom mail-sending script must produce QP for non-ASCII content. Encode message body before assembling the MIME message.
Debugging mojibake in emailβ
Garbled accented characters in delivered email. Trace through QP encoding to find the wrong-charset step.
Forensic email analysisβ
Investigators read raw .eml files. QP decoding makes the content human-readable.
How it worksβ
- Pick mode β Encode (raw text β QP) or decode (QP β raw text).
- Paste content β Raw bytes (with declared charset) for encode; QP-formatted text for decode.
- Apply rules β Encode: bytes 33β60 + 62β126 pass through; others become
=NN. Lines wrap at 76 chars with soft=line breaks. Decode: reverse, joining soft-broken lines. - Inspect β Side-by-side original / encoded view; soft line breaks marked.
- Copy β Result to clipboard. Round-trip via the inverse mode for verification.
Examplesβ
Input: Hello, world! β encode
Output: Hello, world! (no special chars; passes through)
Input: cafΓ© β encode (UTF-8)
Output: caf=C3=A9
Input: caf=C3=A9 β decode
Output: cafΓ©
Frequently asked questionsβ
How is QP different from base64?
Base64 is a safer encoding for arbitrary binary, but inflates size by 33% and is less human-readable. QP is more efficient for mostly-ASCII text with occasional non-ASCII (only inflates the special bytes), and lets readers see most of the content directly.
What is a "soft line break"?
A line ending with =\\r\\n (in CRLF) or =\\n (LF). The decoder removes these, producing one logical long line. Used to satisfy the 76-character line-length rule without breaking content.
Should I encode "=" as "=3D"?
Yes β = itself is special and must be encoded as =3D always.
What about whitespace?
Spaces and tabs at end-of-line must be encoded (=20 / =09) because mail relays sometimes strip trailing whitespace.
Does it preserve UTF-8?
Yes β multi-byte UTF-8 sequences encode byte-by-byte (e.g. Γ© = 0xC3 0xA9 β =C3=A9).
Why does my decoded email show "=" at end of lines?
Those are unencoded soft line breaks that the decoder did not recognise β usually due to wrong line endings (Mac CR vs Unix LF). Normalise line endings first.
Tipsβ
- For programmatic email, use your language's MIME library rather than hand-encoding QP.
- When debugging email mojibake, decode QP first, THEN check charset β the order of operations matters.
- Soft line breaks are the most error-prone part of QP β pay attention to CRLF vs LF normalisation.
- Round-trip via decode after encoding to verify nothing was lost.
- For arbitrary binary, prefer base64 β QP is optimised for mostly-text content only.
Try it nowβ
The full quoted-printable-encoder runs in your browser at https://ztools.zaions.com/quoted-printable-encoder β no signup, no upload, no data leaves your device.
Last updated: 2026-05-05 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub