Skip to main content
ToolsBay

Base64 Encoder & Decoder

Encode text to Base64 or decode it back, with full Unicode support.

Runs entirely in your browser — nothing is uploaded

Plain text

1 line

Base64

1 line

Frequently asked questions

Does it handle accented characters and emoji?

Yes. Text is encoded as UTF-8 first. The browser's built-in btoa() throws on any character above U+00FF, which is why many simple encoders fail on "café" — this one does not.

What is URL-safe Base64?

Standard Base64 uses + and / which have meaning in URLs, and = padding which often gets escaped. URL-safe Base64 substitutes - and _ and drops the padding, so the result can be dropped into a query string or path unchanged. Decoding here accepts either form.

Is Base64 encryption?

No, and this matters. Base64 is a reversible encoding with no key — anyone can decode it instantly. It exists to move binary data through text-only channels, not to hide anything. To hash a value irreversibly, use the hash generator.

Why does the encoded text get longer?

Base64 represents every 3 bytes as 4 characters, so output is about 33% larger than the input. That overhead is the cost of using only characters that survive text transport.

What Base64 is for

Base64 encodes arbitrary binary data using only 64 characters that survive being passed through systems built for text. Email attachments, data URIs in CSS, JSON Web Token segments and HTTP basic auth headers all rely on it.

It is worth being blunt about what it is not: Base64 provides no security whatsoever. There is no key, and decoding is a single function call. Credentials sent as Base64 in an HTTP header are transmitted in effectively plain text, which is exactly why basic auth requires HTTPS.

UTF-8 and the btoa problem

The browser's built-in btoa() only accepts characters in the Latin-1 range. Feed it café and it throws an InvalidCharacterError. The fix is to encode the text to UTF-8 bytes first and Base64 those bytes — which is what this tool does, so any text works, including emoji and non-Latin scripts.

Related tools

To encode an image file as a data URI for inlining in CSS or HTML, use the image to Base64 converter. To inspect a JSON Web Token — which is three Base64url segments — use the JWT decoder. For irreversible hashing, use the hash generator.