Base64 Encode and Decode
The file stays on your device.
How to use
- Pick Encode to turn text into Base64, Decode to read Base64 as text, or File to convert a file from your device.
- Type or paste into the box. The result appears as you type.
- For use inside URLs or file names, tick URL-safe. For embedding a small image in HTML or CSS, convert the file and tick Data URL.
How it works
Base64 takes three bytes (24 bits) at a time and writes them as four characters from a 64-letter alphabet: A to Z, a to z, 0 to 9, plus and slash. If the data does not fill the last group, one or two equals signs are added as padding.
Text is first converted to bytes with UTF-8, so characters outside plain English, such as é, 世 or an emoji, encode and decode correctly instead of throwing an error.
The URL-safe variant swaps plus and slash for hyphen and underscore and drops the padding, so the result can sit in a link without escaping. The decoder accepts both forms, line breaks and missing padding.
FAQ
Is Base64 encryption?
No. Anyone can decode it, so it hides nothing. It only makes binary data safe to carry through text-only channels such as JSON, email or URLs. Never use it to protect secrets.
Why is the Base64 version larger than the original?
Every three bytes become four characters, so the output is about 33 percent bigger, plus a little for padding and line breaks.
Why does decoding say the result is not text?
The Base64 itself is valid, but the bytes inside are not UTF-8 text. That happens with images, PDFs and other binary data. Use the File mode to create Base64 from a file, and save decoded binary with a dedicated tool.
Is my file uploaded?
No. Files are read by your browser and converted on your device. Files are limited to 5 MB because very large Base64 strings can freeze a page.