Base64 Is Not Encryption, and That Matters
By toolbelt maintainers ·
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?
Why does my emoji turn into garbage?
Why does the output end in equals signs?
Why does my base64 fail to decode?
Related tools
- URL Encoder/DecoderPercent-encode and decode URLs. Safely escape query parameters, path segments, or full URLs to ensure they are valid and won't break during browser routing or API requests.
- JWT DecoderDecode JSON Web Tokens to inspect the header and payload. Debug authentication flows, check expiration times, and view user roles without verifying the signature.
- JWT SignerCreate a signed JSON Web Token with HMAC SHA-256, SHA-384 or SHA-512. Encode the header and payload and sign it from a secret, entirely in your browser.
- Env ValidatorCheck a .env file for duplicate keys, unclosed quotes, unquoted spaces and placeholder secrets before they break a deploy. Reports the line number of each problem.