How Base64 works
The algorithm slices input into 3-byte (24-bit) groups, then splits each group into four 6-bit chunks. Each 6-bit value (0–63) maps to one of the 64 alphabet characters. So Man becomes TWFu. If the input length isn't a multiple of 3, the output is padded with = signs — one = if one byte is missing, two if two are missing. That's the entire trick; decoding just reverses it.
Where you'll meet Base64
- 📧 Email attachments — MIME encodes files as Base64 so decades-old mail servers handle them
- 🖼️ Data URIs — tiny images embedded directly in HTML/CSS as
data:image/png;base64,… - 🔌 APIs and JSON — binary blobs smuggled inside text-only payloads
- 🔑 Keys and tokens — cryptographic keys and JWTs are Base64-encoded for transport
Base64 is NOT encryption
This is the critical misunderstanding: Base64 provides zero secrecy. Anyone can decode it in milliseconds — it's a transport format, not a lock. Encoding a password in Base64 is like writing it in a slightly unusual font. For actual protection, use real encryption (AES, TLS) and never treat encoded data as hidden.
❓ Base64 FAQs
What is Base64 encoding?
Representing binary data as ASCII text with 64 characters (A–Z, a–z, 0–9, +, /). Every 3 input bytes become 4 text characters.
What does = at the end mean?
Padding. Base64 processes 3-byte groups; = fills the final block when the input length isn't a multiple of 3.
Is Base64 encryption?
No — anyone can decode it instantly. Never use it to hide passwords or secrets; use real encryption instead.
Where is Base64 used?
Email attachments (MIME), data URIs in web pages, API payloads, and transporting keys and tokens.
Related: What Is a UUID? · What Is JSON? · Free Base64 Tool