Base64 Encoder/Decoder

Free online Base64 encoder and decoder for text and images. Encode/decode UTF-8 safely — everything processed in your browser.

Base64 Encoder/Decoder guide

What Base64 is actually for

Base64 converts any binary data into 64 safe ASCII characters (A-Z, a-z, 0-9, + and /). It exists because many channels — email (historically), JSON, XML, URLs, HTTP headers — handle text reliably but mangle raw binary. Encoding images into CSS/HTML, embedding tokens in JWTs, and shipping binary attachments through text-based APIs are all the same trick.

The cost: every 3 bytes become 4 characters — a 33% size increase. Never Base64 a large file when a URL or binary upload would do.

The Unicode trap in JavaScript

The naive btoa(“中文”) throws or corrupts, because btoa only understands Latin-1 characters. The safe pattern is btoa(unescape(encodeURIComponent(str))) or, in modern code, encoding to UTF-8 bytes first and base64-ing the bytes. This tool uses the UTF-8-safe path, so Chinese, emoji and mixed scripts round-trip correctly — decode(encode(x)) always returns exactly x.

Encoding vs encryption — say it with confidence

Base64 has no key and no secrecy: anyone with the string can decode it in one step. It appears in passwords-in-config files and “obfuscated” API params, and it stops no one. If data must be secret, encrypt it (AES for data, proper password hashing like bcrypt for passwords) and use Base64 only as the final transport encoding if needed.

FAQ

Does it support Chinese/Unicode text?
Yes — UTF-8 aware encoding, unlike naive implementations that corrupt multi-byte characters.
Can I encode images to Base64?
Yes — useful for inlining small images into CSS or HTML.
Is Base64 encryption?
No, it is an encoding, not encryption — anyone can decode it. Do not use it to protect secrets.