Understanding Base64 Encoding: RFC 4648 Bit Splitting & Data URI Overhead
Base64 is a binary-to-text encoding scheme that translates raw 8-bit binary bytes into a restricted 64-character ASCII alphabet (A-Z, a-z, 0-9, +, /). It enables binary media like images and audio to travel safely over text-only protocols like SMTP email and JSON APIs.
How the 24-bit to 4-Character Bit Mapping Works
Base64 processes binary data in 24-bit chunks (three 8-bit bytes) and splits them into four 6-bit numbers (each ranging from 0 to 63). If the input length is not divisible by 3, padding '=' characters are appended. This causes an inherent 33% size expansion compared to raw binary.
Frequently Asked Questions
Because Base64 is 33% larger than binary, and inline Data URIs cannot be cached independently by the browser like standard external image files.
Get Free Creator & Security Toolkits
Join over 14,000 developers, producers, and designers. Receive offline cheat sheets, zero-bloat web utilities, and exclusive feature releases.
