DevTools

Base64 Encoder/Decoder

Encode and decode Base64 text and files, including URL-safe.

Plain text

0 chars

Base64

About Base64 Encoder/Decoder

Convert text to Base64 and back. Unicode is handled properly — text is converted to UTF-8 bytes before encoding, which is where naive implementations fall over.

URL-safe Base64

Standard Base64 uses + and /, both of which have meaning inside a URL, and = padding that often gets mangled in query strings. URL-safe Base64 substitutes - and _ and drops the padding. It is what JWTs use, and decoding here accepts either form.

Base64 is not encryption

Encoding is reversible by anyone, with no key involved. It exists to move binary data through text-only channels such as email bodies, JSON fields and data URIs — not to keep anything secret.

Frequently asked questions

Why does Base64 make my data larger?
It represents three bytes with four characters, so output grows by roughly a third. That overhead is the price of surviving text-only transport.
Why did my emoji or accented text break elsewhere?
Because btoa alone cannot handle characters above U+00FF. The text has to be encoded as UTF-8 bytes first, which this tool does — a step many code snippets skip.
Can I decode a data URI?
Paste only the part after the comma. The data:mime/type;base64, prefix is metadata, not part of the encoded payload.

Related tools