Base64 Encode and Decode
Full Unicode support, a URL-safe variant, and nothing sent anywhere.
Base64 is not encryption
This is worth stating first because it is the single most common misunderstanding. Base64 hides nothing. Anyone who sees an encoded string can decode it instantly, with no key, no password and no skill. It exists to move data that may contain any byte value through a channel that only reliably carries text, such as an email body, a JSON field, a data URI or an HTTP header.
If something needs to be kept secret, it needs encryption. Base64 is what you use so that encrypted bytes survive the journey, not what makes them secret.
Why other tools break on accented letters
The browser's built-in btoa function only accepts characters in the Latin-1 range and throws an error on anything outside it, so a naive implementation fails the moment you paste a café, a Cyrillic word or an emoji. Some tools work around this by silently discarding those characters, which is worse, because the round trip quietly loses data.
The correct handling is to convert the text to UTF-8 bytes first and encode those. That is what happens here, so café 🚀 encodes and decodes back to exactly café 🚀, and so does any other script.
The URL-safe alphabet
Standard Base64 uses + and / as its last two characters. Both mean something in a URL, so a value pasted into a path or a query string gets re-encoded and often arrives corrupted. The URL-safe variant substitutes - and _, and commonly drops the trailing = padding, which is why JSON Web Tokens look the way they do. Decoding here accepts either alphabet without being told which one you used.
How the encoding works
Base64 takes three bytes at a time, which is 24 bits, and splits them into four groups of six. Each six-bit group indexes a 64-character alphabet, giving four printable characters for every three bytes of input. That is why the output is roughly a third larger than the input.
When the input does not divide evenly by three, the final group is padded and marked with one or two = characters so a decoder knows how many bytes to discard. Dropping that padding is safe when the receiver knows the length, which is the assumption tokens make, and unsafe otherwise.
| Input | Base64 | Note |
|---|---|---|
| Man | TWFu | Three bytes, no padding needed |
| Ma | TWE= | Two bytes, one padding character |
| M | TQ== | One byte, two padding characters |
| café | Y2Fmw6k= | The é becomes two UTF-8 bytes |
How to use it
Type or paste, then press Encode or Decode. The options apply to encoding: URL-safe alphabet swaps the last two characters, Drop the = padding trims the tail, and Wrap at 76 characters breaks the output into lines, which is what email and PEM formats expect. Decoding ignores all three and accepts whatever you give it, including line breaks and either alphabet.
Questions
Does Base64 encrypt my data?
No, and this is the most important thing to know about it. Base64 is an encoding, not encryption: anyone can decode it in seconds with no key and no effort. Use it to move binary data safely through text channels, never to hide anything.
Why do accented letters and emoji work here when other tools fail?
The browser function btoa only accepts characters in the Latin-1 range and throws on anything else. This tool converts the text to UTF-8 bytes first and encodes those, which is the correct handling and makes any language and any emoji round-trip exactly.
What is URL-safe Base64?
Standard Base64 uses plus and slash, both of which have meaning in a URL and get re-encoded on the way through. The URL-safe variant substitutes minus and underscore, and usually drops the equals padding, so the value survives being placed in a path, a query string or a filename.
Why is my encoded text longer than the original?
Base64 represents three bytes with four characters, so the result is about a third larger, plus padding. That overhead is the price of being safe to send through channels that only handle text.
Is my data uploaded anywhere?
No. The conversion runs inside your browser and this tool has no backend, so nothing you paste is transmitted, logged or stored.
Related tools
Browse all Sigma Wire tools - every free tool on the site, grouped by category.