How to use it
- Choose Encode or Decode.
- Paste your text or Base64 in the first box. The result appears as you type.
- Press "Copy result", or "Swap" to feed the result back in the other way.
How Base64 works
Base64 turns any data into 64 safe characters (AโZ, aโz, 0โ9, + and /) so it can travel through email, web addresses, JSON and other places made for text. Text is first turned into bytes using UTF-8, then every 3 bytes (24 bits) become 4 characters of 6 bits each. If the last group is short, = signs pad it. So Base64 is always about a third bigger than the original.
Worked examples
How much bigger Base64 makes things
Every 3 bytes become 4 characters, so Base64 is about a third larger than the original:
| Original size | Base64 length |
|---|---|
| 100 bytes | 136 characters |
| 1,000 bytes | 1,336 characters |
| 10,000 bytes | 13,336 characters |
| 1 MB (1,048,576 bytes) | 1,398,104 characters |
That's why putting large pictures straight into web pages or emails as Base64 makes them heavier. For pictures, our image compressor can shrink the file first.
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode Base64, so it hides nothing. Never use it to protect passwords or private data.
What's URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in web addresses. URL-safe Base64 (described in RFC 4648) uses - and _ instead and usually drops the = padding, so the result can go straight into a link or file name. Our decoder reads both.
Why does decoding say "it isn't text"?
The Base64 is fine, but the data inside is something else, such as a picture. Pictures are often stored as data URLs starting with data:image/png;base64,.