Base64 encodes binary data as plain ASCII text, so it can travel safely through channels that only handle text — email bodies, JSON payloads, data URIs and HTTP headers. This converter encodes and decodes both text and files, and handles Unicode correctly, which many Base64 tools get wrong.
How to encode and decode
Switch between Encode and Decode with the mode buttons; the conversion runs as you type.
- Encode: paste text (or drop a file) and copy the Base64 output.
- Decode: paste Base64 and read the original text back.
- Enable the URL-safe alphabet when the value goes into a URL or a JWT.
- Enable line wrapping at 76 characters when the value goes into an email or PEM file.
Base64 is encoding, not encryption
Anyone can decode Base64 — it needs no key and provides no secrecy whatsoever. It exists to make binary data survive text-only transport, not to protect it.
Never use Base64 to hide passwords, tokens or personal data. If you need confidentiality, you need encryption; if you need integrity, you need a signature or a hash.
URL-safe Base64
Standard Base64 uses + and / which both have special meaning in URLs, and = padding which is awkward in query strings. The URL-safe variant defined in RFC 4648 replaces + with -, / with _, and drops the padding.
JSON Web Tokens use this variant, which is why a JWT segment pasted into a standard decoder sometimes fails until you switch the alphabet.
Why Unicode breaks naive tools
The browser's built-in btoa function only accepts characters in the Latin-1 range, so anything with an emoji, an accent or CJK text throws an error. This tool encodes text to UTF-8 bytes first and Base64-encodes those bytes, which is the behaviour almost everyone actually wants.
On the way back, decoded bytes are validated as UTF-8 rather than being silently replaced with question marks, so corrupted input is reported instead of quietly producing wrong text.
FAQ
Why is Base64 longer than the original?
Base64 represents every three bytes as four ASCII characters, so encoded output is roughly 33% larger than the input, plus padding. That overhead is the price of making binary data safe to transmit as text.
Can I Base64 encode an image?
Yes — switch to the File tab and drop the image in. The result can be used directly in a data URI. Keep in mind that embedding large images this way inflates your HTML or CSS and usually loads more slowly than a normal image request.
What does the = at the end mean?
It is padding. Base64 works in blocks of three input bytes; when the final block is short, one or two = characters pad the output to a multiple of four. URL-safe Base64 usually omits it.
Is my data uploaded?
No. Encoding and decoding both happen locally in your browser, including for files. Nothing is transmitted or stored anywhere.