Base64 Encoder & Decoder

Convert text or a file to Base64 and back again. Handles UTF-8 correctly, including emoji and Chinese, which naive implementations break on.

100% local

Everything runs locally in your browser. Your files are never uploaded to any server.

No account, no queue, no file size limit imposed by a server. You can confirm this in your browser's Network panel while the tool works.

Output is ~33% larger than the input.

How to use this tool

Base64 is an encoding, not encryption. It turns arbitrary bytes into 64 printable characters so binary data can travel through systems that only accept text — email attachments, data URLs, JSON payloads, Basic auth headers. Anyone can decode it in one step, so never use it to hide a password or an API key.

The output is always about 33% larger than the input, because every three bytes become four characters, and the equals signs at the end are padding that fills out the final group. If you see one = the input length was two more than a multiple of three; two == means one more.

Text is converted with TextEncoder first, so multi-byte characters survive the round trip. Doing this correctly matters: the common btoa(text) shortcut throws on any non-Latin-1 character, which is why so many online encoders mangle Chinese or accented text. File mode reads the bytes directly and produces a data URL you can paste into CSS or HTML.

Frequently asked questions

Is Base64 a form of encryption?

No. It is reversible by anyone without a key. Use it for transport compatibility, never for secrecy — for passwords use a hash such as bcrypt or Argon2.

Why is the encoded output 33% bigger?

Every 3 input bytes become 4 output characters, so the size grows by 4/3. Padding with = accounts for the remainder.

Can it decode Base64URL (with - and _)?

Yes. The decoder accepts both the standard alphabet and the URL-safe variant used by JWT and most token formats.

Is my file uploaded?

No. Files are read with FileReader in the tab. A 10 MB file never leaves your disk.

Related tools