What is encoding (base64, quoted-printable)?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

Encoding is how email systems convert data that isn't plain text (attachments, images, special characters, emojis) into a format that can travel through SMTP without breaking. SMTP was designed in the 1980s to move plain ASCII text, so anything else needs translation.

The two methods you'll see most:

  • Base64 converts binary data (like a PDF or image file) into text. It inflates file size by about 33%, but it's reliable and every email client understands it.
  • Quoted-printable is lighter for text with occasional special characters (like an é or a curly quote). It leaves most ASCII alone and only encodes what needs it, so it's more readable if you inspect the raw email source.

You don't usually choose encoding yourself. Your ESP or email library handles it automatically when you attach a file or use non-ASCII characters. The only time you'll think about it is if you're building your own SMTP integration or debugging why an attachment arrives corrupted.

One encoding quirk that affects deliverability: if your email's total size after encoding pushes past certain mailbox limits (often 25-50 MB), it'll bounce. Base64's 33% inflation means a 20 MB video becomes 26.6 MB encoded, which can quietly hit limits you didn't plan for.

And if you're ever inspecting raw email source and see =3D or =20, that's quoted-printable. If you see long strings of random-looking letters and numbers, that's Base64. Both are working correctly. If an attachment shows up as gibberish in the inbox, the encoding failed or the client doesn't support it (extremely rare now, but it happens with very old systems).

Want to see encoding in action? View the source of any email with an image attachment. You can use our Email Source Analyzer to decode what's happening under the hood.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Get encoding help for your setup

I read this on the Email Almanac about email encoding (Base64 and quoted-printable): "Encoding converts attachments, images, and special characters into plain text so they can travel through SMTP. Base64 inflates file size by ~33%, quoted-printable is lighter for text with occasional non-ASCII characters. Your ESP handles this automatically, but it matters for email size limits and debugging corrupted attachments." Help me understand how this applies to MY specific situation: 1. If I'm hitting size limits: Calculate your attachment's encoded size (original × 1.33 for Base64). If you're near mailbox limits (often 25-50 MB), you're at risk of bounces. 2. If attachments arrive corrupted: Check if your SMTP library is encoding correctly. Inspect raw source for proper Content-Transfer-Encoding headers. 3. If special characters look broken: Your encoding might be mixing quoted-printable and UTF-8 incorrectly. Most ESPs handle this, but custom SMTP setups can mess it up. 4. If you're building custom email: Use a library (Nodemailer, Python's email module, etc.) that handles encoding automatically. Don't try to Base64-encode manually unless you know what you're doing. --- My details (fill in what applies): - Email platform/ESP: e.g. Mailchimp, SendGrid, custom SMTP server - What I'm sending: [e.g. receipts with PDF attachments, newsletters with images, marketing emails with emojis] - Current issue: [e.g. attachments over 20 MB bouncing, special characters showing as ??, raw email source looks wrong] - Experience level: beginner / intermediate / advanced - What prompted this: describe what made you look up encoding

Edit the yellow boxes, then send to the AI of your choice.