BackendBench
Coffee
Free tool

Base64 encode & decode

Convert text to Base64 and back. Unicode-safe, with a URL-safe option. Everything stays in your browser.

Output

What Base64 is for

Base64 represents any bytes using 64 safe text characters (A-Z, a-z, 0-9, + and /). It is how binary data travels inside JSON, emails, data URIs, HTTP Basic authentication headers and JWTs. The price is size: Base64 output is about a third larger than the input.

This tool encodes text as UTF-8 first, so accented letters, emoji and non-Latin scripts round-trip correctly. Decoding tolerates line breaks and either the standard or URL-safe alphabet.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide secrets. It exists to carry binary or special characters safely through text-only channels.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant swaps them for - and _ and usually drops the = padding. JWTs use it.

Why does decoding show an error about UTF-8?

The text decoded to bytes that are not valid UTF-8, which usually means the original was binary (an image or a file) and not text.

How do I do this in Java?

Base64.getEncoder().encodeToString(text.getBytes(StandardCharsets.UTF_8)) to encode, and new String(Base64.getDecoder().decode(s), StandardCharsets.UTF_8) to decode. Use getUrlEncoder() for the URL-safe form.

More tools you might need