How to Encode and Decode Base64
Base64 exists to move binary data through channels that only handle text. It represents every three bytes as four printable characters, which is why an encoded string is always about a third larger than what went in. Paste text on the left and the result appears instantly — and unlike most browser-based encoders, this one handles emoji, Devanagari and accented characters correctly rather than throwing an error.
Choose a direction
Encode turns text into Base64; decode turns it back. If you paste the wrong kind, you are offered a switch.
Pick the variant if needed
Standard for most uses. URL-safe when the result goes into a URL or filename, since + and / cause trouble there.
Copy the result
It converts as you type. Copy it, download it, or send it back to the input to convert again.
Why Most Base64 Tools Break on Emoji
The browser has a built-in function called btoa, and almost every simple online encoder calls it directly. The problem is that it only understands Latin-1 — characters up to code point 255. Give it an emoji, a Hindi word, or even a curly quote copied from a word processor, and it throws an error rather than encoding anything.
The fix is to convert the text to UTF-8 bytes first, then Base64-encode those bytes. That is what this tool does in both directions, which is why it round-trips any language faithfully. If you have ever pasted text into a Base64 tool and received an unhelpful error, this is almost certainly why.
The other thing worth knowing is the URL-safe variant. Standard Base64 uses + and /, which both have meaning inside a URL — a plus becomes a space when a query string is parsed, and a slash looks like a path separator. The URL-safe variant substitutes - and _ and drops the padding. It is what JWTs use, and what you want for anything that ends up in a link.
Common Situations This Tool Solves
Reading a Base64 blob from a config or API
Credentials, certificates and tokens are routinely stored Base64-encoded. Decoding shows you what is actually in there.
Passing data through a text-only channel
Email headers, JSON fields, URLs and database text columns all need binary turned into text before it can travel.
Debugging a JWT or an auth header
Both are Base64 under the surface. Decoding the middle section of a token reveals its claims immediately.
Embedding a small file in code
Encoding a file produces a string you can paste directly into a script or config, with no separate asset to ship.
Frequently Asked Questions
How do I encode text to Base64 for free?
Paste it on the left and the encoded result appears instantly. Free, no signup, and nothing is uploaded.
Why do other Base64 tools fail on emoji or Hindi?
They call the browser's btoa directly, which only handles characters up to code point 255. This tool converts to UTF-8 bytes first, so any language works.
Is Base64 encryption?
No, and this matters. It is an encoding, fully reversible by anyone. Never use it to protect a password or anything sensitive.
Why is the encoded output larger?
Base64 represents three bytes using four characters, so the result is around 33 percent bigger. That overhead is inherent to the format.
What is the URL-safe variant?
It replaces + and / with - and _, because those two characters have special meaning inside a URL. It is what JWTs use.
What does the = padding at the end mean?
It pads the output to a multiple of four characters. The URL-safe variant usually drops it, and this tool restores it automatically when decoding.
Is my data uploaded to a server?
No. Everything runs inside your browser, which matters since people routinely paste tokens and credentials into these tools.
Can I encode a file?
Yes. Drop any file onto the input box and it is encoded in full, up to about 25 MB.
Why does decoding say the result is binary?
Because the decoded bytes are not valid text - the input was probably an encoded image or file rather than a string.
What is the 76-character wrapping for?
MIME requires Base64 in email headers to be wrapped at 76 characters. You only need it when producing output for email.
Can I decode URL-safe Base64 here?
Yes. Both variants are accepted on decode regardless of which is selected, since people paste whatever they were given.
Is this Base64 tool really free?
Completely free, with no limits, no signup and no premium wall. Everything runs in your browser.
Last updated: July 21, 2026 · FlipMyFormat Base64 Encoder
Written and maintained by the FlipMyFormat team
