Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 back to text — handles accents, emoji and any UTF-8 text correctly, all in your browser.
How it works
Paste text or Base64
Anything from a short string to a full document — accents and emoji included.
Encode or decode
Pick the direction you need. Invalid Base64 shows a clear error instead of garbage output.
Copy or swap
Copy the result, or swap input and output to chain another conversion.
What people use a Base64 tool for
Base64 shows up anywhere binary data needs to travel as plain text.
Embedding images as data: URIs
Decoding API auth tokens
Reading email attachment headers
Inspecting JSON payloads
Debugging config/env values
A few things worth knowing
Base64 is an encoding, not encryption or compression. It takes any sequence of bytes and represents it using only 64 printable characters (A–Z, a–z, 0–9, + and /, with = as end padding), which is why it's safe to drop into places that only understand plain text — but anyone can decode it back instantly, with no key required. If you need to hide data from view, Base64 does not do that; if you need to protect it, use real encryption.
Getting UTF-8 right matters more than it seems. A naive browser encoder that calls btoa() directly on a JavaScript string breaks the moment that string contains an accented letter, an emoji, or most non-English text, because btoa() only understands one byte per character. This tool avoids that by converting your text to its actual UTF-8 byte sequence first (via TextEncoder), Base64-encoding those bytes, and reversing the same path on decode (via TextDecoder) — so round-tripping accented and multi-byte text always returns exactly what you started with.
Decoding invalid input is handled explicitly rather than left to throw an uncaught error: the tool checks the character set, the length, and finally whether the decoded bytes form valid UTF-8, and reports which of those failed instead of showing a blank or broken result.
Frequently asked questions
What is Base64 actually for?
Base64 turns arbitrary binary data into a string made only of letters, digits, + and /, so it can safely travel through systems that only expect plain text — email attachments, JSON payloads, URLs, embedded images in CSS/HTML (data: URIs), and API authentication headers. It's an encoding for safe transport, not a form of compression or encryption.
Why does encoding text with accents or emoji sometimes break?
The browser's built-in btoa() function only understands "binary strings" — one character per byte, values 0–255. Feed it a character outside that range (an accented letter, an emoji, most non-English text) and it throws an error, because those characters need more than one byte once encoded as UTF-8. This tool converts your text to its real UTF-8 bytes first with TextEncoder, then Base64-encodes those bytes, so accents and emoji round-trip correctly.
Is Base64 encoding the same as encryption?
No. Base64 is fully reversible by anyone with no secret key required — decoding it is a mechanical operation, not a security measure. Never use Base64 alone to "hide" sensitive data like passwords or tokens; use real encryption if confidentiality matters.
Why did decoding fail with an error?
Valid Base64 only uses the letters A–Z and a–z, digits 0–9, the characters + and /, and = padding at the end, and its length (ignoring whitespace) must be a multiple of 4. If your input has any other character, is missing padding, or the decoded bytes don't form valid UTF-8 text, the tool shows a specific error instead of silently producing garbage.
Does encoding make text bigger?
Yes — Base64 represents every 3 bytes of original data as 4 characters, so encoded output is roughly 33% larger than the original. That overhead is the tradeoff for being safely representable as plain text.
Is this Base64 tool free to use?
Yes, completely free, with no account, no sign-up, and everything computed locally in your browser — nothing you paste here is ever uploaded.