Base64 Encode / Decode
🔒 Runs in your browser
How Base64 encoding works
Base64 represents arbitrary binary data using 64 printable ASCII characters (A–Z, a–z, 0–9,
+ and /), by regrouping every three bytes into four 6-bit values.
This tool first converts your text to UTF-8 bytes with the browser's native
TextEncoder, then Base64-encodes those bytes — so diacritics, emoji and any
script round-trip exactly on decode, unlike naive implementations that encode raw UTF-16
code units directly.
URL-safe Base64 and files
Standard Base64 uses + and / and pads the output with
= signs, both of which need escaping inside a URL or filename. The URL-safe
toggle switches to - and _ and drops the padding (RFC 4648 §5), so
the result can be dropped straight into a query string or a filename. File encoding works
the same way: files are read locally in your browser and encoded on your device — nothing
is uploaded — into a full data:<mime>;base64,… URI.
Frequently asked questions
Does this handle Unicode correctly?
Yes. Text is encoded to UTF-8 bytes before Base64, so diacritics, emoji and any script round-trip exactly — unlike naive btoa() implementations.
What is URL-safe Base64?
A variant using - and _ instead of + and /, with padding removed, safe to place in URLs and filenames (RFC 4648 §5).
Is my file uploaded?
No. Files are read locally in your browser and encoded on your device — nothing is uploaded.