Base64 encode/decode · Guide
Base64 Encoding Explained
Base64 is simpler than it looks. Understanding the mechanism explains its quirks — the length increase, the padding, and why some characters appear.
Bits into six-bit groups
Base64 reads the input three bytes (24 bits) at a time and splits them into four groups of six bits. Each six-bit group maps to one character in the 64-character alphabet, which is why three bytes become four characters.
The alphabet and padding
The standard alphabet is A–Z, a–z, 0–9, plus + and /. When the input length is not a multiple of three, the output is padded with one or two = signs so the length is always a multiple of four.
Why it grows data
Because every three bytes become four characters, Base64 output is roughly 33% larger than the input. That overhead is the price of being text-safe.
Frequently asked questions
Can I use this for production work?
Yes, for inspection, formatting and quick generation. Still review the output before committing it to production code or configuration.
Ready to try it?
Open the free browser-based Base64 encode/decode and apply what you just read — no sign-up, runs locally.
Open the Base64 encode/decode tool