Free tool · runs in your browser

Base64 Encoder & Decoder

Convert text to Base64 and back. Handles accented characters, CJK text and emoji correctly, with an optional URL-safe alphabet.

Base64 is encoding, not encryption

Base64 maps binary bytes to 64 printable characters so data can travel through systems that only accept text. Anyone can decode it instantly. It provides no confidentiality, no integrity and no authentication.

Use it for embedding small assets, transporting binary payloads in JSON, or reading the payload of a token. Use encryption or a signed token when secrecy or tamper evidence is required.

The btoa trap with non-Latin text

The browser's btoa() throws on characters outside Latin-1. Naive tools therefore mangle names, Chinese text and emoji. This tool first encodes the string as UTF-8 bytes with TextEncoder, then Base64-encodes those bytes, so decoding returns the original text.

The same rule applies in reverse: Base64 has no built-in notion of character encoding. If the source was not UTF-8, the decoded text will be wrong even though the bytes are correct.

URL-safe Base64

Standard Base64 uses + and /, which are special in URLs, and pads with =. The URL-safe variant (RFC 4648 §5) replaces them with - and _ and often drops padding. JWTs, some OAuth values and many URL parameters use it.

The decoder here accepts both alphabets and restores missing padding, so you can paste either form.

Frequently asked questions

Can I decode a JWT payload with this?

Yes, paste the middle segment. It is Base64URL-encoded JSON. Decoding only reveals the claims; it does not verify the signature, so never trust the contents until the token is verified server-side.

Why is the output longer than the input?

Base64 represents every three bytes as four characters, so the encoded size is about 4/3 of the original, plus padding.

Does it work with images or files?

This tool is text-only. Encoding arbitrary binary files changes the meaning of the bytes, so use a command-line tool or a file-specific encoder for that.

Is Base64 safe for passwords?

No. Base64 is reversible by anyone; it is not a security control. Use a password hash on the server, never reversible encoding.

Why does decoding fail?

The input may contain characters outside the Base64 alphabet, be truncated, or come from a different encoding. Whitespace is ignored, but corrupted characters are not.

New tools, straight to your inbox

One short email when we add tools worth using. No spam, unsubscribe anytime.