Web Analytics
Skip to content
← All tools

Base64 Encode / Decode

Encode text to Base64 or decode Base64 back to text. UTF-8 safe.

Runs 100% in your browser — nothing is uploaded.

About Base64 encoding and decoding

Base64 turns any data into a string of 64 safe, printable characters (A to Z, a to z, 0 to 9, plus + and /). It exists because a lot of systems only handle text reliably. Email bodies, JSON fields, data URLs, and cookies all expect text, so binary data like an image or a raw key has to be dressed up as text before it can travel through them. Base64 is that costume.

This tool encodes and decodes in both directions, entirely in your browser. Nothing you paste is uploaded, which matters when the value is a token, a small key, or anything you would not send to a random website. It is also UTF-8 safe, so emoji and non-Latin text survive the round trip instead of turning into garbled characters.

When you actually need it

The most common cases are embedding and transport. A data URL like data:image/png;base64,... puts a whole image inline in HTML or CSS. A JSON Web Token carries Base64url-encoded parts. An API might ask you to send a file as a Base64 string inside a JSON request. In each of these, the goal is the same: move bytes through a text-only channel without losing them.

Encode takes your text (or the text form of some data) and produces the Base64 string. Decode reverses it. If decoding fails, the input is not valid Base64, usually because of a stray space, a line break, or wrong padding. Base64 strings are padded with = at the end so their length is a multiple of four.

Base64 is not encryption

This is the one thing worth being clear about: Base64 hides nothing. Anyone can decode it in one step, exactly like this tool does. It is an encoding, not a cipher, so never use it to protect a password or a secret. If you need secrecy, you need actual encryption. Base64 only makes data safe to transport, not safe to expose.

Why the output is bigger

Base64 represents every 3 bytes of input with 4 characters of output, so the encoded string is about 33 percent larger than the original. That overhead is the price of text safety. It is why you embed small images as data URLs but link to large ones, and why APIs that move big files usually prefer a direct binary upload over a Base64 payload.

Want to see where the 33 percent comes from, how padding works, and why Base64URL uses a different alphabet? Read our plain-English guide to Base64 encoding.