Encode
Decode
InputHello, world!
Base64SGVsbG8sIHdvcmxkIQ==

The formula

3 bytes4 Base64 characters3\ \text{bytes} \rightarrow 4\ \text{Base64 characters}
3 bytes — the input is read three bytes at a time
4 characters — each group becomes four printable characters
= — padding when the input does not divide evenly

How it works

Encode text to Base64, or decode a Base64 string back to text. Enter your text, choose encode or decode, and the result appears instantly — handling any language through UTF-8.

FAQ

What is Base64 for?

Base64 turns any data into a string of 64 safe, printable characters. It is used to carry binary data — images, files, keys — through systems that only handle text, such as email, JSON and data URLs. It is an encoding, not encryption: anyone can decode it, so it provides no security on its own.

Why does the output end in one or two “=” signs?

Base64 works in groups of three bytes, which become four characters. When the input length is not a multiple of three, the final group is padded with one or two “=” signs so the output length is always a multiple of four. The padding is removed automatically when decoding.

Why is the Base64 output longer than the original text?

Each three bytes of input become four output characters, so encoded text is about 33% larger than the original. That overhead is the price of representing arbitrary binary data with a small set of safe, printable characters.

Why do some Base64 strings use “-” and “_” instead of “+” and “/”?

That is Base64URL, a variant that swaps the two characters that are unsafe in URLs and filenames. It is common in JWT tokens and web links; this tool produces and expects the standard Base64 alphabet with “+” and “/”.

Why does decoding fail on some input?

Decoding needs a valid Base64 alphabet and correct padding. Text that was never Base64 — or that got truncated, had characters swapped, or lost its “=” padding — will not decode into valid bytes, and the tool flags it rather than showing garbage.

Does encoding the same text always give the same result?

Yes. Base64 encoding is deterministic with no randomness or key involved, so the same input always produces the exact same output, which makes it reliable for things like generating consistent cache keys or comparing values.

Can Base64 be reversed by anyone without a password?

Yes — that is expected. Base64 is an encoding for safe transport, not a secret, so anyone with the string can decode it instantly with this or any other Base64 tool; use real encryption if the content needs to stay private.

About the Base64 encode / decode tool

This tool converts text to and from Base64, the encoding that represents data using 64 printable characters. Encoding turns your text into a Base64 string; decoding turns a Base64 string back into readable text. It is fully UTF-8 aware, so text in any language round-trips correctly, and it runs entirely in your browser without sending anything to a server.

How to use it

Type or paste your text, then choose Encode to produce a Base64 string or Decode to recover the original from one. The result shows immediately. For example, “Hello, world!” encodes to “SGVsbG8sIHdvcmxkIQ==”, and decoding that string returns the original phrase. Invalid Base64 input is flagged when decoding.

The formula

Base64 reads the input three bytes at a time — 24 bits — and splits each group into four six-bit numbers, each mapped to one of 64 characters, so 3 bytes4 characters3\ \text{bytes} \rightarrow 4\ \text{characters}. If the final group is short, it is padded with “=” signs. Decoding reverses this, turning every four characters back into up to three bytes and reassembling the original text.

Where it is used

Developers meet Base64 everywhere: embedding images directly in HTML or CSS as data URLs, encoding attachments in email, carrying binary fields in JSON and tokens, and storing keys in configuration files. This tool is handy for quickly encoding a value to paste into code, or decoding one you have received to see what it contains.