Base64 Encode Decode, Both Ways in One Tool
Runs 100% in your browser — your text never leaves this page, and nothing is uploaded or stored.
This base64 encode decode tool converts text to Base64 and back on proper UTF-8, so accents, Arabic, Chinese and emoji survive the round trip. Use it to base64 encode online for APIs, data URIs and email, or decode base64 to text again — accents, Arabic, Chinese and emoji all survive the round trip on proper UTF-8.
How to use the Base64 Encode Decode Tool
- Choose a direction with the Mode switch: Encode text → Base64, or Decode Base64 → text.
- Paste or type into the Your text box — or press Load sample to encode a sentence full of accents and an emoji.
- Your result appears in the Result box as you type; there is nothing to submit.
- Decoding is the same motion in reverse — paste the full Base64, padding and all, and the original text comes back exactly.
- Copy the result with one click, or download it as a .txt file.
About this tool
Base64 turns binary and text data into a safe alphabet of 64 characters that survives email systems, URLs, JSON and HTML. It is how images ride inside CSS, how attachments ride inside email, and how countless APIs pass tokens and payloads. This implementation encodes your text as UTF-8 first, so accented letters, Arabic, Chinese and emoji all round-trip perfectly — something many quick encoders get wrong by mangling anything outside plain ASCII. Two things about the output surprise people. It is longer than what you typed — roughly a third longer, because every three bytes of input are carried by four Base64 characters. And it sometimes ends in one or two “=” signs: that padding tops the output up to a multiple of four characters. Both are signs of correct Base64, not errors — a decoder expects exactly that. When decoding fails here, the tool says so plainly instead of handing you garbage. The usual causes are a copy that was cut short, characters from a URL-safe variant (which uses - and _ in place of + and / — convert those back first), or text that was never Base64 at all. Paste the complete string, padding included, and genuine Base64 always opens. Base64 is one of a trio: when the text has to travel inside a link instead, the url encoder percent-encodes it, and when it has to sit safely inside a web page, the html encoder escapes it. The alphabet and padding rules used here are the ones set out in MDN's glossary entry on Base64, which follows RFC 4648.Worked example
The tool's sample sentence, encoded with Mode set to Encode text → Base64: You type (text)Hello, World! Base64 handles émojis 🎉 and ünïcode with ease.You get (Base64)
SGVsbG8sIFdvcmxkISBCYXNlNjQgaGFuZGxlcyDDqW1vamlzIPCfjokgYW5kIMO8bsOvY29kZSB3aXRoIGVhc2UuSwitch Mode to Decode and paste that string back, and the sentence returns exactly — accents, emoji and all — because the text was converted to UTF-8 bytes before encoding. The output is longer than the input, as Base64 always is: three bytes in, four characters out.
Features
- Both directions in one tool — a single Mode switch between encoding and decoding.
- UTF-8 done properly: accents, Arabic, Chinese and emoji encode and decode exactly, with no mangled characters.
- Honest errors: invalid input gets a clear “not valid Base64” message instead of silent garbage.
- Whitespace-tolerant decoding — Base64 copied with line breaks from an email or a document still decodes.
- Instant results as you type, even on long payloads, which are processed in chunks.
- Private by design — encoding happens in your browser, so tokens and payload text stay on your device.