Base64 Encoder and Decoder

Encode text to base64 or decode base64 back to text, right in your browser. Bad input shows a clear error.

Last updated: 17 November 2026.

Unicode is handled correctly, so emoji and text in any language round-trip without damage.

What base64 is, in plain words

Base64 is a way of writing any data using only 64 safe characters: the letters A to Z, the letters a to z, the digits 0 to 9, the plus sign, and the slash. An equals sign is added at the end as padding when the length needs it. That is the whole alphabet, and it is chosen on purpose. These characters survive almost anywhere text can go: inside a web address, inside an email, inside a settings file, or inside a line of code. Other characters, such as line breaks, spaces, and control characters, can break those places, so base64 gives you a version of your data that travels safely.

Base64 is not encryption

The most important thing to know about base64 is what it is not. It is not encryption, it is not a password, and it does not hide anything. Anyone who sees a base64 string can decode it in seconds, with a tool like this one, with a line of code, or even by hand if they are patient. It is a change of shape, not a lock. If you encode the word secret, you get c2VjcmV0, and anyone who decodes that string gets the word secret back at once.

That said, base64 does have a real security use: it stops data from being damaged in transit. When a system expects plain text and receives raw bytes, it may strip, change, or reject some of them. Base64 wraps those bytes in safe characters first, so they arrive intact. The receiver then decodes them back to the original bytes. The data is not hidden, but it is protected from accidental damage, and that is often all you need.

Encoding and decoding, step by step

To encode, paste your text in the left box and press Encode to base64. The result appears in the right box, ready to copy. To decode, paste a base64 string in the left box and press Decode from base64. The original text appears in the right box. The Swap button moves the output back into the input, which is handy when you want to decode a string and then encode the result again, or when you want to check your work by going round the trip: encode a sentence, swap, decode it, and you should get the exact sentence back.

If decoding fails, the tool shows a clear error instead of a silent wrong answer. The most common cause is a damaged string. A space in the middle, a line break, a missing equals sign at the end, or a character that base64 does not use will all break it. Copying from a chat app or a document can add invisible characters, and copying from a web page can add extra spaces. The fix is usually simple: remove spaces and line breaks, check the equals signs at the end, and try again. If the string came from a long email, check that no part of it was cut off, because a missing chunk breaks the whole string.

The Unicode trap, and why this tool avoids it

Many simple base64 tools break on emoji and non-English text, and the reason is a quiet detail in how browsers handle text. The built in functions, btoa and atob, only understand the Latin-1 character set, which covers English and a few European letters. Feed them an emoji, an Arabic letter, or a Chinese character, and they throw an error or produce damaged output. The fix is to convert the text to UTF-8 bytes first, and then encode those bytes. That is what this tool does, using TextEncoder and TextDecoder, so the full range of Unicode works: emoji, accented letters, Arabic, Urdu, Chinese, and everything else.

Structured data has the same need. If you work with JSON, you will often need to encode a JSON object before sending it somewhere, or decode one that arrives as base64. To check the JSON itself, use the JSON formatter to format it, shrink it, or find the exact line of an error. And if the text you are encoding is a secret, do not encode it and share it: make a fresh one instead, with the password generator, and keep it in a password manager.

For everyday use, the pattern is simple. Encode when you need to paste data somewhere that only accepts text. Decode when someone hands you a base64 string and you want to read it. Check the round trip when it matters, keep secrets out of base64, and remember that the tool runs on your device, so the text you type here never leaves it.

Privacy and how the tool works

This encoder and decoder runs fully in your browser. The conversion is done with plain JavaScript on your device, and nothing you type, encode, or decode is sent to a server, saved, or shared. There is no account, no upload, and no record of the text you work with. You can encode a sensitive string, copy the result, and close the page, and nothing remains behind. That privacy is by design, and it is one reason to prefer a browser tool like this one over pasting text into a server that you do not control.

Frequently asked questions

Is base64 the same as encryption?

No. Base64 only changes how text looks, so anyone can decode it in seconds. It hides nothing. Never use it to protect a password, a secret, or any private information.

Why did my text turn into strange characters?

That is normal for base64. It turns any text into a mix of letters, numbers, plus signs, slashes, and equals signs. Decode it again and you get the exact text back.

Why does decoding sometimes fail?

Decoding fails when the input is not valid base64. Common causes are a missing equals sign at the end, a space or line break in the middle, or a character that base64 does not use. Check the text and try again.

Does this tool handle emoji and other languages?

Yes. It converts text to bytes with UTF-8 first, so emoji, accented letters, Arabic, Urdu, Chinese, and every other Unicode text round-trips correctly.

Is my text sent anywhere?

No. Encoding and decoding run in your browser with plain JavaScript. The text you type never leaves your device, and nothing is stored.