MIME Base64 Encoder

Encode to RFC 2045 line-wrapped Base64, the format used for email attachments. Read more in Base64 for email attachments.

0 characters

Standard vs. MIME Base64

Standard Base64 (used in APIs, data URIs and JWTs) is a single unbroken line. MIME Base64 inserts a line break every 76 characters, a requirement inherited from early SMTP servers that could not reliably transmit arbitrarily long lines. Need unwrapped output? Use the standard encoder instead.

MIME Base64 — FAQ

What is MIME Base64?+

MIME (RFC 2045) Base64 is standard Base64 wrapped at 76 characters per line, separated by CRLF line breaks. It is the format email clients use to encode attachments.

Why does MIME Base64 wrap at 76 characters?+

Older email transport (SMTP) had line-length limits, so RFC 2045 requires encoded body lines to be no longer than 76 characters to guarantee safe delivery through any mail relay.

Is MIME Base64 different from regular Base64?+

The underlying alphabet and encoding is identical — only the line wrapping differs. Decoding simply requires stripping the line breaks before running standard Base64 decoding.

Do I need MIME wrapping for APIs or JWTs?+

No. APIs, JWTs and data URIs use unwrapped standard or URL-safe Base64. MIME wrapping is specific to email (and some legacy protocols) — see this tool's standard mode or the URL-Safe tool otherwise.