Skip to content

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

  1. Choose a direction with the Mode switch: Encode text → Base64, or Decode Base64 → text.
  2. Paste or type into the Your text box — or press Load sample to encode a sentence full of accents and an emoji.
  3. Your result appears in the Result box as you type; there is nothing to submit.
  4. Decoding is the same motion in reverse — paste the full Base64, padding and all, and the original text comes back exactly.
  5. 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)
SGVsbG8sIFdvcmxkISBCYXNlNjQgaGFuZGxlcyDDqW1vamlzIPCfjokgYW5kIMO8bsOvY29kZSB3aXRoIGVhc2Uu
Switch 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.

Base64 Encode Decode FAQs

Is Base64 encryption?No. Base64 is an encoding, not encryption — anyone can decode it instantly. Never use it to protect passwords or secrets.
Why does Base64 end with = signs sometimes?Those are padding. Base64 output length must be a multiple of four, so one or two “=” characters are added when needed.
Can I encode an image here?This tool handles text. For files, the same Base64 principle applies, but you would paste the result of a file encoder instead.
Is my data sent anywhere?No — encoding happens locally in your browser, which is exactly where sensitive payloads belong.
Why is the Base64 output longer than my text?By design: Base64 carries every three bytes of input in four characters, so the output runs about a third longer — and more for text heavy in multi-byte characters, since an emoji that displays as one symbol is four bytes underneath.
What does “not valid Base64” actually mean?The decoder met characters outside the Base64 alphabet, or the string's length and padding are broken — usually a copy that was trimmed, or a URL-safe variant that uses - and _ instead of + and /. Restore the full string, including any trailing = signs, and try again.
Does it work for long text and other languages?Yes to both. Long payloads are processed in chunks so big texts do not stall the page, and because encoding starts from UTF-8, text in any language — Arabic, Urdu, Chinese, Cyrillic — round-trips exactly.
More text encoder decoder tools →