Base64 Encoder & Decoder

Both directions, with UTF-8 handled properly.

At a glance

InputBase64 text, or text to encode
OutputThe decoded text, or the encoded string
Character setUTF-8, so non-English text survives the round trip
Where it runsEntirely in your browser — no file is uploaded to a server
PriceFree, with no account and no sign-up
OfflineWorks with no connection after the first visit

Base64 is not encryption

It is an encoding: a way of writing arbitrary bytes using 64 printable characters so they survive systems that expect text. Anyone can decode it instantly, with no key, because there is no key. Putting a password in Base64 hides it from a casual glance and from nobody else.

It also costs space — the result is about a third larger than the input, since every three bytes become four characters.

Where the accents break

Base64 encodes bytes, not characters, so the text has to become bytes first. JavaScript’s built-in btoa() throws on anything outside Latin-1, which is why so many implementations mangle accented and CJK text.

Text here is encoded as UTF-8 before Base64 and decoded back the same way, so café and 中文 survive the round trip intact.

The URL-safe variant

Standard Base64 uses + and /, both of which mean something else in a URL, and = padding that some parsers dislike. The URL-safe alphabet substitutes - and _ and usually drops the padding.

That is the variant inside a JWT. If you are pasting a token segment and getting gibberish, this is usually why — the JWT decoder handles the whole structure for you.

Frequently asked questions

Is Base64 secure?

Not at all — it is an encoding, not encryption. Anyone can decode it instantly with no key. Never use it to protect anything.

Why does my decoded text have strange characters?

Almost always a UTF-8 mismatch. Text has to be turned into bytes before encoding; implementations that skip that step break on anything outside plain ASCII.

What is URL-safe Base64?

A variant using - and _ instead of + and /, because those two have meaning inside a URL. It is what JWTs use, which is why a raw decoder often fails on a token.

How much bigger does Base64 make a file?

About 33 per cent. Three bytes become four characters, plus padding. That is the price of making binary safe to paste into text.

Something wrong with this tool, or an idea for it? Tell us