Base64 Encoder & Decoder

Base64 encode any text, or decode it straight back, with correct UTF-8 handling for accents, emoji and non-Latin scripts. Drop in a file to get a data URI, with a live preview for images.

How to use Base64 Encoder & Decoder

  1. Paste text into the box — the tool auto-detects whether it is plain text or Base64 and converts accordingly.
  2. Force a direction with the Encode / Decode switch if the auto-detection guesses wrong.
  3. Pick the standard alphabet or the URL-safe variant, which swaps + and / for - and _ and drops padding.
  4. Switch to the File tab and drop any file to get a Base64 data URI, plus an image preview when it applies.
  5. Copy the result or download it as a text file.

About Base64 Encoder & Decoder

Base64 exists because a great deal of internet plumbing still assumes text. Email bodies, JSON fields, XML attributes, HTTP headers, URLs and source files all handle printable ASCII reliably and arbitrary bytes badly. Base64 maps every three bytes onto four characters drawn from a 64-symbol alphabet, so any binary blob — an image, a certificate, a compressed archive — can travel through a text-only pipe and come out the other side byte-identical.

The single most common bug in Base64 tooling is Unicode. The browser’s built-in btoa() operates on a "binary string" where each character must be a single byte, so passing it anything outside Latin-1 either throws an InvalidCharacterError or quietly corrupts the data. The correct pipeline is text → UTF-8 bytes → Base64, and back again on decode, which is what this converter does with TextEncoder and TextDecoder. That is why a string of emoji survives a round trip here and not everywhere.

The file side of the tool produces a full data URI — data:image/png;base64,… — which is what you want for inlining a small icon in CSS, embedding a logo in an HTML email, or pasting an asset into a config file. Because Base64 adds about a third to the payload, the tool shows the original and encoded sizes side by side; as a rule of thumb, inlining is a win under about 4 KB and a mistake well above it.

Frequently asked questions

Is Base64 encryption?

No, and this is the most important thing to know about it. Base64 is an encoding, not a cipher — anyone can decode it in a second with no key. Never use it to hide passwords, tokens or personal data; use it to move binary safely through text-only channels.

Why do accented characters and emoji break in other Base64 tools?

Because they call btoa() directly, which only accepts code points below 256 and throws or mangles anything above. This tool converts text to UTF-8 bytes with TextEncoder first, so é, 日本語 and 🎉 round-trip perfectly.

What is URL-safe Base64?

A variant defined in RFC 4648 §5 that replaces + with - and / with _, and usually omits the = padding, so the result can be dropped into a URL path or query string without percent-encoding. JWTs use it.

Are my files uploaded when I convert them?

No. Files are read with the browser’s FileReader API and encoded in memory on your own device. Nothing is sent anywhere, which is why this is safe for certificates, keys and private images.

How much bigger does Base64 make a file?

Roughly 33% — every three bytes become four characters, plus padding. The byte-size readout shows the exact before and after figures so you can judge whether inlining an asset as a data URI is worth the page weight.

Can I decode a Base64 string back into a file?

Text output can be copied or downloaded directly. For binary payloads, paste the Base64 into the text box and download the decoded result — the tool writes the raw bytes rather than re-encoding them as text.

Related tools

All developer tools · Browse all 56 free tools →