Encode text to Base64 or decode Base64 back to text β runs entirely in your browser.
Try it
How it works
The browser has built-in Base64 functions:
// Encode (with UTF-8 support)
btoa(unescape(encodeURIComponent(text)));
// Decode (with UTF-8 support)
decodeURIComponent(escape(atob(base64)));
The encodeURIComponent / unescape trick handles UTF-8 characters that btoa canβt process on its own.
When youβd use this
- Encoding API keys or credentials for HTTP headers (
Authorization: Basic <base64>) - Debugging JWT tokens (the payload is Base64-encoded)
- Embedding small images as data URIs in CSS/HTML
- Decoding Base64 blobs from APIs