Base64 Encoder / Decoder

Encode any text to Base64 or decode Base64 back to readable text — UTF-8 safe (Urdu, Arabic, emoji all work), entirely in your browser.

What is Base64?

Base64 is a way of writing any data — text in any language, images, files — using only 64 safe, printable characters: A–Z, a–z, 0–9, + and / (with = as padding). It exists because many systems were built to carry plain text only: email protocols, URLs, XML, JSON, HTML attributes. Base64 lets binary or special-character data travel through those text-only channels without corruption. It is encoding, not encryption — anyone can decode it instantly, so it hides nothing; it only makes data safe to transport.

How to use this tool

Paste text and press Encode to get its Base64 form, or paste a Base64 string and press Decode to recover the original. The implementation is UTF-8 safe, which matters: naive Base64 tools corrupt Urdu, Arabic, Chinese and emoji, while this one round-trips them perfectly. Everything runs locally in your browser — safe for tokens and credentials, nothing is transmitted.

How it works

text → UTF-8 bytes → groups of 3 bytes → 4 characters of [A-Za-z0-9+/]
(output is ~33% larger than the input)

Every 3 bytes of data become 4 Base64 characters, which is why encoded strings are about a third longer than the original. Missing final bytes are marked with = padding.

Worked example

A developer needs to put the text Salam, دنیا into a JSON config that chokes on non-ASCII characters. Encoding gives U2FsYW0sINiv2YbbjNin — pure ASCII, safe anywhere. The consuming service decodes it back to the exact original, Urdu intact. Likewise, decoding the classic SGVsbG8gV29ybGQ= reveals Hello World — try it above. If you've ever seen a data:image/png;base64,… URL in a web page, that is an entire image travelling as Base64 text.

When is this useful?

Developers embedding images or fonts as data URIs, debugging API tokens and JWT segments (each part of a JWT is Base64), reading email attachments' raw source, storing binary data in JSON/XML, crafting Authorization: Basic headers, and safely sharing snippets that mangle in chat apps. Remember the golden rule: Base64 is a envelope, not a lock — for anything secret, use real encryption. Related utilities: the case converter and CSV ⇄ JSON converter for other text-wrangling jobs.

Frequently asked questions

Is Base64 encryption?

No. It's a reversible encoding anyone can decode in milliseconds — including this page. It protects data from corruption in transit, never from prying eyes. Use proper encryption for secrets.

Why does my decoded output look like gibberish?

Either the input wasn't valid Base64, or it encodes binary data (like an image) rather than text. This tool decodes to text; binary content won't display meaningfully.

Does this handle Urdu, Arabic and emoji?

Yes — text is converted through UTF-8 bytes before encoding, so any language or emoji round-trips exactly. Many older tools skip this step and corrupt non-English text.

What are the = signs at the end?

Padding. Base64 works in 3-byte groups; when the data isn't a multiple of 3, one or two = characters fill the final group.

Is it safe to paste API keys here?

The encoding runs entirely in your browser and nothing is sent to any server — you can verify by loading the page and going offline. Still, standard hygiene applies: avoid pasting secrets on shared computers.