Base64 Encode / Decode

Convert text to Base64 or decode it back, live as you type. Full UTF-8 support, so accented letters, emoji, and non-Latin scripts round-trip correctly.

URL-safe variant

What Base64 is for

Binary-safe text, not encryption.

Base64 turns arbitrary bytes into a string using only letters, digits, +, and /, safe to embed in JSON, URLs, or email where raw binary would break. It's not encryption: anyone can decode it back instantly, so it doesn't hide or protect anything on its own.

URL-safe variant

Standard Base64's + and / characters have special meaning in URLs. The URL-safe variant swaps them for - and _ and drops the trailing = padding, so the result can go straight into a query string or file name.

How it works

When you encode, your text is first converted to raw UTF-8 bytes with the browser's TextEncoder API, and those bytes are fed to the built-in btoa() function. That first step matters: btoa() on its own only handles Latin-1 characters and throws on anything else, so tools that skip it silently break on emoji, accents, or any non-Latin script. Decoding runs the same pipeline in reverse: atob() turns the Base64 back into bytes, and TextDecoder reassembles them into text. The decoder is also deliberately forgiving: it trims whitespace, accepts both the standard and URL-safe alphabets, and re-adds any stripped = padding, so a segment copied straight out of a JWT or query string decodes without hand-fixing.

Expect the output to be about 33% bigger than the input. Base64 uses 64 symbols, and 64 symbols can only carry 6 bits each, so every 3 bytes of input become 4 characters of output. That's why inlining a 1 MB image as a Base64 data URI costs you roughly 1.37 MB of HTML, and why Base64 is a transport format, not a compression format.

Both directions run in this page's own JavaScript on every keystroke, using nothing but btoa, atob, and the text encoding APIs your browser already ships. You can verify that: open DevTools, switch to the Network tab, and type away. No request ever carries your text anywhere.