Skip to content

Base64 encode & decode

Text or files, both directions

Nothing yet

Base64

This tool runs entirely inside your browser. Your files are never uploaded, never stored, and never seen by anyone but you.

What Base64 is for

It writes arbitrary bytes using only letters, digits and a couple of symbols, so they can travel somewhere that only accepts text — inside a URL, an email, a JSON field, a cookie. It is not encryption and hides nothing: anyone can decode it, including this page.

Any language, correctly

The browser's own btoa refuses anything outside Latin-1, which is why so many tools mangle accents, Greek, Arabic, Chinese or emoji. This encodes the text to UTF-8 first and works from the bytes, so こんにちは and 🙂 round-trip exactly.

URL-safe, and padding

Standard Base64 uses + and /, which have their own meaning inside a URL. The URL-safe variant swaps them for - and _. JWTs use that variant and drop the = padding — both switches are here for exactly that. Decoding accepts either without being told which.

Files and data URLs

Encoding a file gives you its Base64, or a data: URL ready to paste into CSS or an img tag. Be aware Base64 is about a third larger than the bytes it carries, so inlining a large image costs more than linking it.

Decoding works the other way: paste a whole data URL and the prefix is handled for you. If the result turns out to be a PNG or a PDF rather than text, you are offered the file rather than a screen of gibberish.

Is my data sent anywhere?

No. Everything happens in your browser. That matters here more than the name suggests — Base64 payloads pasted into a decoder are very often tokens, session cookies or API responses.

Limits

Files up to 20 MB. Text has no limit beyond what your browser will hold in a text box.

Related tools