Quoted-Printable Encoding: Email Guide
Encode and decode quoted-printable text — used in MIME emails to preserve special characters.
Published:
Tags: quoted-printable encoding, QP encoding email, MIME quoted printable
Quoted-Printable Encoding: Email Guide Part of our complete guide to this topic — see the full series. Quoted-printable keeps your email text human-readable while safely encoding non-ASCII characters for transport through legacy mail servers. --- All the tools discussed here are available for free at theproductguy.in — client-side, no sign-up required. Why Email Needs Content-Transfer-Encoding? SMTP (Simple Mail Transfer Protocol), defined in 1982, was designed for 7-bit ASCII text only. Many relay servers still strip the 8th bit of each byte — any character with a code above 127 would be corrupted in transit. MIME (Multipurpose Internet Mail Extensions, RFC 2045) solved this by adding the header. This header tells the receiving mail client how the body was encoded before transmission.…
Frequently Asked Questions
What is quoted-printable encoding?
Quoted-printable (QP) is a MIME content-transfer encoding for email. It keeps printable ASCII characters (33–126) as literal characters and encodes everything else as '=XX' where XX is the two-digit uppercase hexadecimal value of the byte. Lines are limited to 76 characters with soft line breaks signaled by a trailing equals sign.
Why is quoted-printable used in emails?
SMTP was designed for 7-bit ASCII text. Quoted-printable allows emails to contain non-ASCII characters (like accented letters, ©, or non-Latin scripts) while remaining safe to transport through legacy mail systems that strip the 8th bit. It keeps most of the text human-readable, unlike Base64 which encodes everything.
How do I encode a string as quoted-printable?
Leave any printable ASCII character (except '=') as-is. Replace '=' with '=3D'. Replace any byte outside 33–126, or any trailing space or tab on a line, with '=XX' using uppercase hex. Ensure lines do not exceed 76 characters, adding '=\n' (soft line break) where needed.
What is soft line break in quoted-printable?
A soft line break is an equals sign at the end of a line (=\n or =\r\n) that signals the line should be joined with the next when decoding. It exists purely to respect the 76-character line limit without changing the content. Hard line breaks in the actual content are preserved literally.
How does quoted-printable compare to Base64?
Quoted-printable is more efficient for text that is mostly ASCII — it only encodes non-ASCII bytes, so an English email with a few accented characters stays largely readable. Base64 encodes everything, adding about 33% overhead but producing a fixed-format output that is safer for binary data. QP is preferred for HTML and plain text email bodies; Base64 is preferred for attachments.
All articles · theproductguy.in