Base64 Encoder & Decoder

Encode text to Base64 or decode it back, with full UTF-8 support.

Text or Base64

Base64

Output Result

What Base64 is actually for

Base64 is an encoding, not encryption. It maps arbitrary bytes onto 64 printable ASCII characters so binary data can survive channels built for text — email bodies, JSON string fields, data URIs, HTTP headers. Anyone can decode it instantly, so it protects nothing.

The cost is size. Every three bytes of input become four characters of output, so encoded data is about 33% larger than the original, plus padding. That is why embedding a large image as a data URI bloats a stylesheet more than the file size suggests.

Unicode is where naive implementations break. The browser’s btoa works on bytes, not characters, and throws on anything above U+00FF — so encoding an emoji fails outright. This tool encodes to UTF-8 first, so accented text, CJK characters, and emoji all round-trip correctly.

Frequently asked questions

Is Base64 encryption?

No. It is a reversible encoding with no key, and anyone can decode it. Never use it to protect passwords, tokens, or personal data — it only makes them unreadable at a glance, not secure.

Why does my Base64 string end in = signs?

Base64 works in three-byte groups. When the input length is not a multiple of three, the output is padded with one or two = characters so the length stays a multiple of four. It is structural, not part of the data.

Does this handle emoji and non-English text?

Yes. Input is converted to UTF-8 bytes before encoding, and decoded output is read back as UTF-8, so emoji, accented characters, and CJK text survive a round trip intact.

Why does decoding fail on my string?

Usually the input is not valid Base64 — it may have been truncated, had URL-safe characters (- and _) substituted, or already be plain text. Check that the length is a multiple of four after padding.

How much larger does Base64 make data?

About 33%, since three bytes become four characters, plus up to two padding characters.