Base64 Encode / Decode
- Pick a mode: encode or decode.
- Paste or type your text.
- The result updates as you type and can be copied directly.
Base64 represents binary data using only 64 safe characters: uppercase and lowercase letters, digits, plus + and /. The equals sign at the end is padding, filling out the final block.
Its purpose is to cross channels that only accept text — an email body, a JSON field, an HTML attribute, a data URL in CSS. Without the conversion, arbitrary bytes would corrupt the message.
The arithmetic is simple: every 3 bytes become 4 characters. That is why the result is always about 33% larger than the input. Embedding a large image as a data URI grows the page by that same proportion.
The browser’s native btoa function only accepts single-byte characters and fails on any text containing an accent, a cedilla or an emoji.
This tool works around that by converting the text to UTF-8 with TextEncoder before encoding, and reversing the path with TextDecoder when decoding. So "ação" and "日本語" work without error.
If your code breaks with btoa on accented text, that is exactly the missing step.
Encoding is not encryption. Anyone can decode Base64 in a second, with no key and no effort.
Storing a password, a token or personal data in Base64 believing it is protected is a common and dangerous mistake. Protection requires actual encryption.
The text you paste never leaves your browser: the conversion is local and nothing is logged.
Frequently asked questions
No. It is just a way of representing data using safe characters. The conversion is public and reversible by anyone, without a key.
Because the browser’s btoa function only handles single-byte characters. The text must be converted to UTF-8 first, which this tool does automatically.
They are padding. Base64 processes input in 3-byte blocks; when the final block is incomplete, one or two equals signs pad the output.
It is a variant swapping + for - and / for _, because those two characters have special meaning in URLs. It is the encoding used in JWTs.
For small icons, yes: it removes a request. For large images, no, because the file grows by a third, is not cached separately, and delays page rendering.