Encode and decode Base64 for text and binary files
Every 3 input bytes (24 bits) are split into four 6-bit groups. Each 6-bit group maps to one of 64 printable characters: A–Z (values 0–25), a–z (26–51), 0–9 (52–61), + (62), and / (63). This is why Base64 output is always ~33% larger than the original.
If the input length is not a multiple of 3 bytes, one or two = characters are appended so the output length is always a multiple of 4. One = means 1 padding byte was added; == means 2 padding bytes were added.
Data URIs (embedding images in CSS/HTML), MIME email attachments (RFC 2045), JSON payloads carrying binary data, HTTP Basic Authentication headers (username:password), and storing binary blobs in text-only systems like databases or configuration files.
We use cookies
We use Google Analytics to understand how visitors use this site. No personal data is sold or shared with third parties. Privacy Policy