Base64
A binary-to-text encoding scheme that represents arbitrary binary data using only 64 printable ASCII characters, widely used in email to safely transmit attachments and binary content.
Base64 (defined in RFC 4648) encodes every 3 bytes of binary input as 4 printable ASCII characters, chosen from the alphabet A–Z, a–z, 0–9, +, and /. Padding characters (=) are added if the input length is not a multiple of 3. The result is about 33% larger than the original data but contains no characters that could be misinterpreted by text-based mail transport systems.
In MIME email, Base64 is the standard transfer encoding for attachments and binary content. The Content-Transfer-Encoding header is set to base64, and the encoded data appears in the message body in lines of up to 76 characters. When a mail client downloads the message, it decodes the Base64 data back to the original binary before presenting it to the user.
Base64 is also used to encode inline images and, in some cases, HTML bodies or text with heavy use of non-ASCII characters. An email reader must decode Base64 parts transparently so the user sees the original content rather than the encoded ASCII text. Mbox Viewer decodes Base64 as part of its MIME processing pipeline.
Related terms
A MIME transfer encoding that represents text with mostly ASCII characters, escaping non-ASCII bytes as =XX hex sequences. It keeps the majority of the text human-readable in the raw message source.
A file — such as a PDF, image, or spreadsheet — embedded in an email message and encoded as a MIME part, separate from the message body, intended for the recipient to save or open.