Base64 Encode/Decode
Encode and decode Base64 text with UTF-8 support; use the image tool for files
FAQ
Is Base64 encryption?
No. Base64 is just an encoding that turns binary data into text. Anyone can decode it instantly, so it provides no confidentiality — use real encryption such as AES when secrecy matters.
Why is Chinese text garbled after Base64 decoding?
Usually a character set mismatch — the original was not encoded as UTF-8, for example GBK. Re-encode with the correct charset before converting.
How much larger does Base64 make content?
About 33% larger (every 3 bytes become 4 characters), plus a little padding. That is why large files are a poor fit for Base64 transport.
About this tool
The alphabet is standard Base64 — A-Z, a-z, 0-9, + and /. Every 3 bytes become 4 characters, short groups are padded with =, and the output is a single line with no wrapping.
Chinese works because of the encoding step: the browser's native btoa accepts Latin-1 only and throws on CJK input, so the string is first split into UTF-8 bytes and then encoded. One Chinese character is 3 bytes and becomes 4 Base64 characters; one emoji is 4 bytes and becomes 8 — which is a quick way to tell from the length alone roughly what the source was. Decoding reverses it: atob gives back the byte string, which is then read as UTF-8.
This is not encryption — there is no key and anyone can decode it. The real trap is alphabet variants: this tool uses standard Base64 (+ and /), while JWTs and URL parameters use base64url (- and _), and the two are not interchangeable — swap them back first. MIME encoding also inserts a line break every 76 characters, so strip newlines before decoding, and a string missing its = padding will not decode at all.
This tool works on text. For images and PDFs use the image-to-Base64 tool, which produces a DataURL you can drop straight into src. Base64 is a poor fit for large files: size grows by roughly a third and every read costs an extra decode.