Skip to content
toolbelt
Back to Guides

Base64 Is Not Encryption, and That Matters

By ·

Updated

Base64 makes text look scrambled. That is exactly why people put sensitive data in it and call it protected. It is not.

What is this tool?

Base64 turns arbitrary bytes into printable ASCII. It exists because some channels — email headers, URL segments, JSON strings — only carry text safely. The output is longer by about a third, and completely reversible by anyone.

How it works

Every three bytes become four characters from a 64 character alphabet. Decoding reverses it exactly. Because browser btoa and atob predate Unicode, they mangle emoji and non-Latin text, so I encode from UTF-8 bytes instead of passing the string directly.

Example

"hello" → aGVsbG8=
"世界" → 5LiW55WM
"🌍" → 8J+MjQ==

Decoding any of those gives the original text back.

When to use it

Embedding binary in a text protocol. Checking whether a token really is what you think it is. Decoding an email attachment header. Not for hiding anything.

Optimization Tips

If you find yourself base64-encoding a password, stop. It protects nothing and adds a layer that makes audits harder. For secrets, encrypt; for transport, use HTTPS.

Frequently Asked Questions

Is base64 secure?
No. Anyone with the string can decode it in one line of code. It is encoding, not encryption.
Why does my emoji turn into garbage?
Because btoa only handles Latin-1. This tool encodes to UTF-8 first, which is why emoji survive here and break elsewhere.
Why does the output end in equals signs?
Padding. Base64 works in blocks of three bytes, and = fills the incomplete block. Some variants, like base64url, strip the padding.
Why does my base64 fail to decode?
Usually missing padding or an accidental line break. Length must be a multiple of four before padding.

Ready to try it out?

Put this knowledge into practice with our free tool.

Go to Tool

Related tools