What Is Base64? How Encoding Works + Free Online Converter

You see aGVsbG8gd29ybGQ= in API docs, an image data URL starting with data:image/png;base64,, or a long stretch of unreadable characters inside an email attachment — that's all Base64. It's everywhere, yet many people mistake it for encryption.

This guide explains in plain English: what Base64 is, why we need it, and how to convert it by hand. There's a free converter at the end that handles non-English text.

In one sentence: Base64 isn't encryption, it's "translation"

Encryption needs a secret key — without it you can't get the original back. Base64's rules are public: anyone who gets an encoded string can decode it. All it does is "translate" arbitrary binary data into 64 printable characters (A–Z, a–z, 0–9, +, /), plus = as padding.

Why translate at all? Because many text-only contexts can't carry binary data: early email systems, URL parameters, JSON APIs, images embedded in HTML. Base64 is binary data's "common language" in those places.

How it works: 3 bytes become 4 characters

Binary data is processed in groups of 3 bytes (24 bits), split into 4 chunks of 6 bits. Each chunk maps to one character in the encoding table. 3 bytes become 4 characters, so the size grows by about 33%.

A concrete example: hello is 5 bytes. The first 3 bytes hel → encode to aGVs, the remaining 2 bytes lo → encode to bG8= (padded with = when there are fewer than 3 bytes). Put together, that's aGVsbG8=. Decoding is the reverse operation.

What about non-English characters? They're first encoded as UTF-8 bytes (3 bytes per CJK character), then the whole thing is Base64-encoded. So "你好" becomes 5L2g5aW9 — much longer than English text — because that's how many UTF-8 bytes it takes, not a tool bug.

💡 Rather skip the reading? Try it yourself
Open the free "Base64 Encode & Decode" tool — runs locally, no sign-up.
Use Base64 Encode & Decode Free →

Typical uses of Base64

First, data URLs: <img src="data:image/png;base64,iVBOR..."> embeds small icons directly in HTML/CSS, saving one HTTP request. Second, HTTP Basic auth: the username and password in the Authorization header are Base64-encoded (note: that's encoding, not encryption — it must be used with HTTPS). Third, sending files through APIs: JSON can't carry binary data, so small files are commonly Base64-encoded and stuffed into JSON.

  1. Pick a direction: text to Base64 is "encode", Base64 to text is "decode".
  2. Paste your content into the input box (non-English text pastes directly; the tool handles it as UTF-8 automatically).
  3. Click convert and check the result in the output box.
  4. If decoding throws an error, check the string for stray spaces, line breaks, or non-ASCII punctuation.

Two traps beginners fall into

Trap one: treating Base64 as encryption. "Encrypting" a token or password with Base64 and leaving it in frontend code is wide open — anyone can decode it in the browser console. If you need real secrecy, use actual encryption (like AES) or just use HTTPS. Trap two: garbled non-English text. Old tools that don't support UTF-8 produce gibberish when decoding non-English content. Make sure your converter explicitly supports UTF-8 — Quick Toolbox's Base64 tool handles both encoding and decoding in UTF-8 throughout.

FAQ

Is Base64 encryption? Is it secure?
Not at all. Base64 is encoding, with public rules — anyone can decode it, and there's no such thing as a key. Never "encrypt" passwords, tokens, or other sensitive data with it; that's as good as plaintext.
Why is encoded output only letters, numbers, and +/=?
Because the encoding table contains only A–Z, a–z, 0–9, +, /, and = — all printable characters, so nothing like stray line breaks or control characters can break things. That's the whole reason it was invented.
I have a Base64 string — how do I get the original back?
Choose decode mode and convert it once. Make sure there are no stray spaces or line breaks in the Base64 string — remove them first if there are.
Does Base64 make data bigger?
Yes. Base64 data always grows by about 33% (3 bytes become 4 characters). Keep that overhead in mind when sending large files, or send binary data directly instead.

Related Tutorials

Related Tools

📄 SyncPage — real-time document collaboration Review PDFs, slides, Word & Excel files together — present live, annotate in real time, talk by voice. Guests join free from an invite link. Try SyncPage →