MIME Base64 Encoder (Email Lines, 76 chars)
Standard base64 produces one long line of output. MIME base64 (RFC 2045) inserts a line break every 76 characters — required for email message bodies where most mail transports have line length limits. This tool produces both forms side-by-side.
How to use the MIME Base64 Encoder (Email Lines, 76 chars)
Paste input text. Pick line length: 76 for MIME email, 64 for PEM (certificates), or no wrapping for inline use. Output updates live.
Why email wraps Base64 at 76 characters
Plain base64 emits one unbroken line, but email predates that assumption. The MIME standard, RFC 2045, requires base64 in a message body to be split with a line break at most every 76 characters, because old mail transports rejected or mangled very long lines. Each wrapped line stays well within the limits SMTP imposes, so the encoded attachment survives every hop intact.
The 76-character width is the email convention; PEM, the format for certificates and keys, wraps at 64 instead. This tool produces base64 at whichever width you pick — 76 for MIME, 64 for PEM, or no wrapping for inline use — so you can match the format your target expects.
Common use cases
- Email attachments — produce base64 wrapped at 76 characters for a MIME message body.
- PEM blocks — wrap at 64 to match the certificate and key format.
- Crafting raw messages — build a compliant MIME part by hand for testing a mail server.
- Debugging mail — check whether an encoded body uses the line width a transport expects.
- Inline data — switch wrapping off when you need one continuous base64 string.
Frequently asked questions
Why does MIME wrap base64 at 76 characters?
What is the difference between 76-character and 64-character wrapping?
-----BEGIN----- blocks. The content is identical base64; only the line width differs.