Base64 encode and decode
Turn text or a file into Base64, or Base64 back into what it was, as you type. It runs in your browser, so your data stays on your device and is not saved.
How to encode or decode Base64
- Choose Encode or Decode.
- Type or paste in the box, or open a file.
- When encoding, choose URL-safe, no padding, wrapped lines or a data URL if you need one.
- Copy the result, or save it as a file.
Questions
Is my data uploaded or saved?
No. It is read in your browser and kept only until you close the page. This page has no save or share feature, and it writes nothing to your browser's storage. You can check this yourself. Browser extensions can still read any page, so turn off ones you don't trust.
Is Base64 encryption?
No. Anyone can decode it, with no key. It only turns bytes into characters that are safe to send as text. Don't use it to hide a password.
Does it handle accents, Chinese and emoji?
Yes. Text is turned into UTF-8 bytes first, and decoded bytes are read back as UTF-8. The browser's own btoa function alone fails on these characters. Our tests compare the output with Python's base64 module.
What is URL-safe Base64?
It uses - and _ in place of + and /, because those two have a meaning in web addresses. Tokens such as JWTs use it, usually with no padding. Decoding reads both alphabets and missing padding, and tells you when it did so.
Why does decoding say a character is not Base64?
The message gives the place of the first character that can't be part of Base64, counting from 1, with spaces and line breaks counted too. Spaces and line breaks themselves are skipped. If the data was cut short, it says that instead.
What if the decoded data is not text?
If the bytes are not valid UTF-8 or contain a zero byte, the page treats them as a file. It shows the first bytes in hex, names the type if the first bytes match PNG, JPEG, GIF, WebP, PDF, ZIP or gzip, shows a picture, and lets you save the file. The type is a guess from those bytes.
What is the largest file it can encode?
200 MB on a computer. In our test, a 200 MB file encoded in 5 seconds in Chromium on a desktop computer, and a 200 MB Base64 file decoded in 2 seconds, with page pauses under 0.1 seconds. Above 200 KB, the box shows only the start and the file you save has all of it. The 20 MB limit on a phone is an estimate, not a measurement.