🔐 Base64 Encoder / Decoder

Convert text or small images to/from Base64 format. All processing happens in your browser.

✏️ Input (Plain Text)
🔑 Output (Base64)

Base64 turns arbitrary bytes into a string of printable characters so the data can travel through systems that only handle text — email bodies, JSON fields, data URLs, HTTP headers. It is an encoding, not encryption: anyone can decode it in one step. This tool encodes and decodes in the browser, which matters because pasting a token or a payload into a third-party site is a quiet way to leak it.

Why the output is about a third larger

Base64 represents every three bytes as four characters drawn from a 64-symbol alphabet. Three bytes become four, so the encoded form is 33 percent larger before padding. That overhead is the price of fitting binary data into a text channel. It is the reason you should not base64 an image and store it in a database column unless you have a specific reason — you are paying a third more space for the privilege.

Padding and the equals signs

One or two trailing `=` characters appear when the input length is not a multiple of three. They are padding, not data, and they tell the decoder how many bytes the final group contains. Some systems strip them, some require them. If a decoder rejects a string that looks correct, missing padding is a frequent cause.

The variants that break compatibility

Standard base64 uses `+` and `/`, which have meanings in URLs. URL-safe base64 replaces them with `-` and `_`. A string encoded with one variant and decoded with the other produces garbage or an error. JWT uses URL-safe base64 without padding, which is why a token segment sometimes fails to decode in a tool that expects the standard alphabet.

Frequently asked questions

Is base64 encryption?

No. It is a reversible encoding with no key. Anyone can decode it. If you need to protect data, encode it and then encrypt it — base64 alone provides no confidentiality.

Why does my decoded text look like garbled characters?

The original bytes were probably not UTF-8 text — an image or a compressed blob, for example. Decoding produces bytes, and bytes only read as text if they were text to begin with.

Can I base64-encode a file?

Yes, but expect the result to be about a third larger. For embedding small icons in CSS as data URLs it is convenient; for large files it is wasteful compared with serving the file directly.