Skip to content
Developer

Base64 Encoder & Decoder

Convert text to Base64 and back. Unicode works correctly, the URL-safe alphabet is one toggle away, and invalid input is explained rather than silently mangled.

Press Esc to clear

Base64

About the Base64 Encoder & Decoder

Base64 turns arbitrary bytes into 64 printable characters, so they can travel through systems that only handle text — email bodies, JSON strings, URLs, HTTP headers. It is not encryption and provides no secrecy whatsoever; anyone can decode it, which is the entire point of the format.

The mistake almost every naive implementation makes is treating characters as bytes. The browser's built-in encoder works on Latin-1 and throws the moment it meets anything above U+00FF, which means the first emoji or accented name breaks it. This tool encodes through UTF-8 explicitly, so a round trip holds for any input in any script.

The URL-safe variant exists because standard Base64 uses + and /, both of which have meaning inside a URL and get mangled when passed as a query parameter or a path segment. RFC 4648 defines a variant that substitutes - and _ and drops the trailing padding. It is what JWTs use, which is why a JWT segment pasted into a standard Base64 decoder often fails. This tool accepts either alphabet on the way in without being told which.

Invalid input is reported rather than guessed at. There are two distinct failures — characters outside the alphabet, and a length that cannot represent whole bytes — and they get different messages, because they point at different mistakes.

Everything runs in your browser.

Frequently asked questions

Why does my emoji break other Base64 tools?

Because the browser built-in encoder only handles Latin-1 and throws above U+00FF. This tool encodes via UTF-8, so any character in any script round-trips correctly.

What is URL-safe Base64?

A variant that replaces + and / with - and _ and drops the padding, so the result survives being put in a URL. It is what JWT segments use, which is why they often fail in a standard decoder.

Is Base64 a form of encryption?

No. It is an encoding, and anyone can reverse it instantly. It provides no secrecy at all — it exists to move bytes safely through text-only channels.