How Base64 encoding works
Base64 takes a stream of bytes and rewrites it using only 64 printable characters: A–Z, a–z, 0–9, plus + and /. It works by grouping the input three bytes (24 bits) at a time, then splitting those 24 bits into four groups of six bits. Each 6-bit group — a value from 0 to 63 — maps to one Base64 character. When the input length is not a multiple of three, one or two = characters are added as padding.
Because the output uses only safe ASCII, Base64 is everywhere data needs to ride through a text channel: embedding images in HTML or CSS, attaching files to email, encoding tokens in JSON, and putting binary values into URLs. The trade-off is size — Base64 is about 33% larger than the original data, since every three bytes become four characters.
hello is five bytes. Encoding it produces aGVsbG8= — the single = shows that one padding step was needed to complete the final group. Decoding aGVsbG8= gives back hello exactly.Text ↔ Base64 examples
| Text | Base64 |
|---|---|
| hello | aGVsbG8= |
| Hi! | SGkh |
| larely | bGFyZWx5 |
| Base64 | QmFzZTY0 |
| café | Y2Fmw6k= |
Reference note: this tool encodes text as UTF-8 first, so multi-byte characters such as é or emoji round-trip correctly. Remember that Base64 is encoding, not encryption — it hides nothing and protects nothing.
Frequently asked questions
- What is Base64 encoding?
- Base64 represents binary data or text as a string of 64 safe ASCII characters — A–Z, a–z, 0–9, plus + and /. It lets data travel safely through systems that expect plain text, such as email, URLs and JSON.
- How do I decode a Base64 string?
- Paste the Base64 into the tool and switch to Decode mode. It reverses the encoding and shows the original text. If the string is not valid Base64, you get a clear error instead of broken output.
- Is Base64 encryption?
- No. Base64 is encoding, not encryption. Anyone can decode it back with no key or password, so it provides no security. Use real encryption to protect sensitive data.
- What is URL-safe Base64?
- URL-safe Base64 swaps + and / for - and _ and usually drops the = padding, because those characters have special meaning in URLs. The result drops straight into a URL or filename.
- Does Base64 handle emoji and non-English text?
- Yes. This tool encodes text as UTF-8 before converting, so emoji, accented letters and non-Latin scripts are preserved and decode back to the original characters.
- Is my data uploaded?
- No. All encoding and decoding happens locally in your browser. Nothing you type or paste is sent to a server, so it is safe to use with private text.