Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 to text with full UTF-8 support. Toggle URL-safe Base64, convert live as you type, and catch malformed input instantly. Nothing leaves your browser.
Uses + and / · padded
Text is converted to UTF-8 bytes first.
0 chars · 0 bytesWaiting for input.
0 chars · 0 bytesConversion happens in this tab. Nothing is uploaded.
Base64 is encoding, not encryption.
Under the hood
How it works
No black box: every transformation on this page is a documented browser API running on your device.
Base64 is an encoding, not encryption. It makes binary data safe to transport through text channels; anyone can decode it. Never use it to protect secrets.
- 01
Encode UTF-8 first
Text is converted to UTF-8 bytes with TextEncoder, then those bytes are mapped to the Base64 alphabet. This preserves emoji, accents, and every non-ASCII script.
- 02
Validate before decoding
The decoder checks alphabet characters, padding, and length before using atob. The resulting bytes are decoded with a fatal UTF-8 decoder, so invalid text produces a clear error instead of mojibake.
- 03
Optionally go URL-safe
URL-safe Base64 replaces + and / with - and _, and drops trailing padding. It is the variant used in JWTs, URLs, and filenames.
Common questions
Frequently asked
Short answers about how base64 works and where its limits are.
Is Base64 the same as encryption?
No. Base64 is reversible by anyone and offers no confidentiality. It is useful for embedding binary data in JSON, HTML, email, and URLs, but secrets must be encrypted with a real cryptographic tool.
Why does btoa fail on emoji or accented text?
btoa operates on binary strings and throws on characters outside Latin-1. This tool converts text to UTF-8 bytes with TextEncoder before encoding, so emoji and non-English text work correctly.
What is URL-safe Base64?
Standard Base64 uses + and /, which can have special meaning in URLs. URL-safe Base64 (RFC 4648 §5) substitutes - and _ and commonly omits = padding. This tool accepts either alphabet when decoding.
Why is my Base64 valid but not decoded as text?
Base64 can represent arbitrary binary data, not just text. If the decoded bytes are not valid UTF-8, the tool reports an error rather than showing corrupted characters.
All processing happens locally in your browser.
Your tool input is never uploaded. Google AdSense supports the site and may use cookies for advertising.
Keep working
Timestamp Converter
Translate Unix time in seconds or milliseconds into readable dates—across any timezone.
Image ↔ Base64
Convert images to data URIs or restore Base64 text files—without sending files to a server.
Pixel Scramble
Password-shuffle every pixel, then restore it later. Salt is embedded in the PNG.