Base64 Encode
Turn text into base64, in your browser.
About this converter
Base64 turns arbitrary bytes into 64 characters that survive being put somewhere only text is allowed — an email header, a JSON string, a data URI, an environment variable.
It is not encryption and offers no secrecy whatsoever: anyone can decode it in a second, on this very site. It is a transport format, and treating it as a way to hide a password is a recurring and expensive mistake.
This handles Unicode properly, which is where most encoders quietly break. A browser's own btoa throws on anything above U+00FF, so a pound sign or an emoji fails outright — and some tools "fix" that by mangling the character instead. Here the text is encoded to UTF-8 bytes first, which is what every server-side language does and what the thing decoding it will expect.
The URL-safe option swaps + and / for - and _ and drops the trailing = padding, which is what you want for a value going into a query string, a filename or a JWT.
Frequently asked questions
Is base64 a form of encryption?
No, and this is worth being blunt about. Base64 is a way of writing bytes using characters that survive text-only channels. It is fully reversible by anyone with no key and no effort. If you need something kept secret, you need encryption.
Why does my emoji or accented character work here but not elsewhere?
Because the text is converted to UTF-8 bytes before encoding. Encoders built directly on the browser's btoa function reject anything above U+00FF, so £, é and emoji all fail. Encoding the bytes is what PHP, Python and Node all do, so the result matches what your backend will decode.
When should I use the URL-safe option?
Whenever the result goes into a URL, a filename or a JWT. The standard alphabet uses + and /, which mean something else in a URL path or query string, and = padding often needs escaping too. The URL-safe variant avoids all three.
How much bigger does base64 make things?
About a third. Every three bytes become four characters, so expect roughly 133% of the original size. That is the cost of the compatibility, and it is why inlining large images as data URIs is usually a bad trade.
Does what I paste get sent anywhere?
No. The conversion runs in your browser, on your own machine — that is why the result appears as you type rather than after a wait. Nothing is uploaded, nothing is logged, and closing the tab is the end of it. This matters more here than on most pages: tokens, keys and internal data get pasted into tools like this constantly, and most of them are a form that posts to a server.