Base64
Encode or decode text to and from Base64. Handles UTF-8 correctly.
About this tool
Base64 represents binary data (like images) or any string using just 64 safe characters (A–Z, a–z, 0–9, +, /). It is widely used as a "container" for putting binary into places that only accept text. This tool converts between text and Base64 entirely in your browser and never sends your input anywhere.
Where is it used?
- data URI — embed an image directly in HTML/CSS, e.g. <img src="data:image/png;base64,...">.
- Email attachments — MIME encodes attachments into the message body.
- Basic auth — username and password are Base64-encoded when sent (note: this is not encryption).
- JWT — a token's header and payload are Base64 (URL-safe variant).
It is NOT encryption
A common misconception: Base64 is not encryption, just a reversible encoding. No key is needed, and anyone can decode it. It looks like a random string, so it seems hidden, but it provides no protection for secrets whatsoever. Thinking "it is Base64, so it is safe" for a password or token is dangerous. To keep something secret you need actual encryption (a different mechanism).
URL-safe variant and padding
Standard Base64 contains + and /, which have special meaning in URLs and filenames, so a "URL-safe Base64" variant replaces them with - and _. The trailing = is padding (length adjustment) and is sometimes omitted. When you see Base64 in a JWT or query string, it is usually this URL-safe form.
Size grows about 1.33x
Base64 represents 3 bytes with 4 characters, so the result is about 33% larger than the original. Embedding a small image as a data URI saves an HTTP request and helps, but for large images the added size can backfire — so choose based on the use case.
How to use
- Choose “Encode” and enter text to convert it to Base64.
- Choose “Decode” and enter a Base64 string to get the original text back.
- Use “Copy result” to copy the output.
FAQ
Is Base64 encryption?
No. Base64 is an encoding, not encryption. Anyone can trivially reverse it, so it must not be used to protect passwords or sensitive data.
Is my input sent anywhere?
No. Encoding and decoding happen entirely in your browser; your input is never sent to a server.
Why is there a = at the end?
The = is "padding" that aligns the data length to multiples of 3 bytes. One or two may appear and are a normal part of valid Base64.
How much does the size grow?
Base64 grows the data by roughly one third (4/3), because every 3 bytes become 4 characters.
How is URL-safe Base64 different?
Standard Base64 uses + and /, while the URL-safe variant replaces them with - and _. Pick the right variant for your use case.
Does it handle non-English text and emoji?
Yes. Text is treated as UTF-8, so strings with any language or emoji encode and decode correctly.