How this tool works

Pick a mode — Encode turns text into Base64, Decode turns Base64 back into text — then type or paste. The result updates live on every keystroke; there is nothing to submit. Under the input you can see its length in characters and in UTF-8 bytes, and the result panel shows the converted text with its own length and the size change. Swap moves the result back into the input box and flips the mode, so you can check a round trip in one click. Copy puts the result on your clipboard, Download saves it as a .txt file, and Clear empties both boxes. Invalid Base64 never produces a box of gibberish — you get a plain-English error saying what is wrong.

What Base64 actually is

Base64 is a way of writing any data — text, images, program files — using only 64 safe, printable characters: A–Z, a–z, 0–9, plus + and /, with = used as padding at the end. It exists because many systems were built to move text around and nothing else: email servers, URLs, JSON and XML files, configuration formats. Raw bytes can contain values those systems mangle or reject outright. Encoding the bytes as Base64 guarantees the data survives the trip unchanged and can be converted back, byte for byte, at the other end. The name is literal: the data is re-expressed in base 64, the same way ordinary numbers are base 10 and binary is base 2. Nothing about the data is hidden or altered — it is the same information, wearing a text-safe coat.

Base64 is not encryption

This is the single most important thing to understand about Base64: it provides no secrecy whatsoever. Encoding and decoding use a public, fixed alphabet with no key and no password, so anyone who receives a Base64 string can read the original in seconds — this very page will do it. Developers occasionally meet Base64 described as “obfuscation”, and that is all it is: it stops a value being readable at a glance, nothing more. Never encode a password, API key or private message and treat it as protected. If data must stay secret, it needs genuine encryption with a key; Base64's job is transport, not protection.

Why Unicode breaks naive Base64 tools

The classic browser functions for Base64, btoa and atob, only understand Latin-1 — roughly, plain Western European letters. Feed them a string containing ₹, an emoji or most of the world's scripts and they either throw an error or silently produce corrupted output. The fix is to stop treating text as if it were bytes: this tool first converts your text into its UTF-8 byte representation — the standard encoding the web itself uses — encodes those bytes, and on decode turns the bytes back into text with the matching decoder. That is why “Hello, World! 👋 café ₹5.99” survives the round trip here character-for-character: it is a 32-byte message in UTF-8, and every one of those bytes comes back exactly.

Where Base64 shows up in real work

You will meet Base64 constantly once you start looking:

  • Data URIs. Small images and fonts embedded directly in HTML or CSS begin with data:image/png;base64, followed by the encoded file.
  • Email. Attachments travel as Base64 inside MIME messages, because mail servers were designed for text.
  • Tokens and APIs. A JSON Web Token is three Base64 segments joined by dots, and HTTP Basic authentication sends credentials Base64-encoded — convenient, but readable by anyone, which is why it belongs over HTTPS.
  • Configs and payloads. Certificates, keys and binary fields inside JSON or XML are routinely carried as Base64 strings.

Why the output grows by about a third

The maths is fixed: Base64 takes the input three bytes at a time and writes each group as four characters, so the output is always 4/3 the size — about 33% longer — rounded up with one or two = padding characters when the input does not divide neatly by three. The table shows the growth for a few sizes, including the 32-byte example used on this page.

Input (bytes)Base64 (characters)
34
3244
100136
1,0001,336

Common mistakes with Base64

  • Treating Base64 as security. Encoding a password or key and storing it as if it were protected. It is not — decoding is instant and keyless.
  • Blaming the data for a decoder's limits. A string that “fails” in one tool may be perfectly fine; tools that cannot handle Unicode corrupt text that was encoded correctly.
  • Copying a truncated string. Missing characters at the end — or missing = padding — make Base64 undecodable. Copy the whole string, including any trailing = signs.
  • Encoding twice. Encoding text that is already Base64 produces Base64 of Base64; the far end then needs two decode passes and usually gets garbage after one.
  • Expecting it to shrink data. Base64 always grows data by about a third. If size matters, compress first, then encode.