How to use Base64 encode and decode
- Choose Text → Base64 or Base64 → text.
- Type or paste. The result updates as you type.
- For tokens and URLs, switch on URL-safe to get Base64URL.
- Copy the result.
What Base64 is for
Base64 turns any data into plain letters, digits and a few symbols, so it can travel through systems that only handle text: email attachments, data URLs in HTML and CSS, HTTP basic authentication headers, JSON fields that carry binary data, and the three parts of a JSON Web Token.
It is an encoding, not encryption. Anyone can decode it, so it hides nothing. Never use Base64 to protect a password or secret.
Text that round-trips
The browser's built-in btoa function fails on anything outside Latin-1, which is why many online tools break on emoji, accented names or non-Latin scripts. This tool converts your text to UTF-8 bytes first and encodes those, so café, ✓ and 🚀 all survive encoding and decoding unchanged.
When decoding, both the standard alphabet and the URL-safe alphabet are accepted, with or without = padding, and line breaks are ignored. If the decoded bytes aren't valid text, the tool says the input is probably an encoded file or image rather than showing garbled characters.
Base64URL
URL-safe Base64 replaces + with - and / with _ and drops the padding, so the result can sit in a URL or filename without further escaping. JWTs use it for all three parts. Switch on URL-safe when encoding for those cases. Decoding needs no switch: the tool recognises both alphabets automatically.
Privacy
Encoding and decoding happen in your browser as you type, and nothing is saved or sent. Base64 strings often carry credentials, such as basic authentication headers, so keeping them off servers matters.
Examples
Hello encodes to SGVsbG8=. The rocket emoji encodes to 8J+agA== in standard Base64 and to 8J-agA in Base64URL. An HTTP basic authentication header for user alice with password secret is Basic followed by the Base64 of alice:secret, which is YWxpY2U6c2VjcmV0, and which anyone can decode, which is why basic authentication must only ever be used over HTTPS.
Questions
- Why do other tools break emoji and accents?
- The browser's built-in btoa only handles Latin-1 characters. This tool encodes text as UTF-8 first, so any character round-trips correctly.
- Can it decode Base64URL and text without padding?
- Yes. Both alphabets are accepted, with or without = padding, and line breaks are ignored.
- Is Base64 encryption?
- No. Base64 is an encoding that anyone can reverse. Never use it to hide passwords or secrets.