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.
Open the free "Base64 Encode & Decode" tool — runs locally, no sign-up.
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.
- Pick a direction: text to Base64 is "encode", Base64 to text is "decode".
- Paste your content into the input box (non-English text pastes directly; the tool handles it as UTF-8 automatically).
- Click convert and check the result in the output box.
- 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.