Base64 Encode / Decode

Text to Base64 and back — with proper Unicode handling, so Urdu, Arabic and emoji survive the round trip that breaks lesser tools. And it all happens locally: the natural place to decode a token is your own browser, not a stranger's server.

Encode or decode

In short

"Pakistan" → UGFraXN0YW4=. "Hello" → SGVsbG8=. Encoding is not encryption — anyone can reverse it, which is the point of the decode button.

How Base64 works

Base64 is a translation between two alphabets: the 256 possible byte values, and a safe set of 64 printable characters (A–Z, a–z, 0–9, +, /). Three bytes — 24 bits — are regrouped as four 6-bit chunks, each chunk naming one character of the 64. That regrouping is the whole algorithm, and it explains both of Base64's visible traits: the output is always about a third longer than the input, and it ends with = padding when the input does not divide by three. The reason the scheme exists is plumbing: email, and plenty of older systems, were built for 7-bit text and mangle raw bytes, so binary data — images, attachments, keys — travels dressed as text and is undressed at the other end. The one modern subtlety is characters beyond Latin: text must first be turned into bytes, and the only sane universal choice is UTF-8. This tool encodes the UTF-8 bytes of your text (which is why Urdu works here), and decodes assuming UTF-8, falling back gracefully if the bytes are not valid UTF-8.

How to use this tool

  1. Paste or type into the input box.
  2. Press Encode to get Base64, or Decode to recover the text from a Base64 string.
  3. Copy the output.
  4. Remember: decoded something sensitive? It was never secret — Base64 is an envelope, not a safe.

Privacy: encoding and decoding happen in your browser; nothing is uploaded. Do not paste production secrets into any online tool — this one is local by design, but the habit is worth keeping everywhere.

Frequently asked questions

What is Base64 used for?

Base64 represents binary data as plain ASCII text so it can travel through systems designed for text: email attachments (MIME), images embedded in HTML and CSS as data URIs, JSON payloads carrying files, and tokens in web authentication. It encodes every 3 bytes as 4 characters, so the output is about 33% larger than the input.

Why does this tool handle Urdu and emoji when many do not?

Because classic Base64 works on bytes, and browsers' built-in btoa() only accepts Latin-1 characters — it throws an error on Urdu, Arabic, emoji and most of the world's writing. This tool first converts your text to its UTF-8 bytes (the universal encoding), then encodes those, so any text round-trips correctly: 'Pakistan' becomes UGTraXN0YW4= and comes back exactly.

Is Base64 encryption?

No. Base64 is an encoding, not encryption — anyone can decode it instantly, as this page demonstrates. It provides no secrecy whatsoever. Never treat a Base64 string as protected: a 'Base64-encoded password' is a password written in a different alphabet, nothing more.

What does the padding (=) at the end mean?

Base64 works in groups of 3 bytes → 4 characters. When the input length is not a multiple of 3, the final group is short and is padded with = signs to a multiple of 4: one = means the last group held 2 bytes, two = means it held 1 byte. 'Hello' (5 bytes) encodes to SGVsbG8= — the single = tells the decoder the last group had 2 bytes.

Is my data uploaded?

No — and for this tool that matters more than most, because Base64 strings are often tokens and credentials. Encoding and decoding happen in your browser; nothing is transmitted. Verify by going offline: the tool still works.

Related tools