Monu Tools

Base64 Explained: Why Encoding Is Not Encryption

By Monu ToolsLast updated June 30, 2026

Base64 is a way to write binary data using only the plain text characters that survive being copied through email, URLs, and config files. It is not a cipher, not compression, and not a checksum. It is a reversible alphabet swap that anyone can undo, which is exactly why it is so widely used and so widely misunderstood. Paste any text or file into the Base64 Encoder and you can watch the transformation run both ways, entirely in your browser.

Try the Base64 Encoder toolEncode text to Base64 or decode Base64 back to text. UTF-8 safe with automatic direction detection.

What Base64 actually does

Computers store everything as bytes, and a byte can hold any of 256 values. Plenty of channels, though, only handle a safe subset of printable characters. Base64 bridges that gap by regrouping the bits: it takes three bytes at a time (24 bits) and splits them into four groups of six bits. Six bits have 64 possible values, and each one maps to a single character from a fixed 64-character alphabet, A to Z, a to z, 0 to 9, plus the two symbols + and /.

Because four output characters now stand in for every three input bytes, the result is always about one third larger than the original. When the input length is not a clean multiple of three, the encoder pads the final group with one or two = characters so a decoder knows how many real bytes the last block held. That padding is the reason Base64 strings so often end in = or ==.

A worked example

Take the three letters Man. Their byte values are 77, 97, and 110, which in binary is:

M = 01001101   a = 01100001   n = 01101110

24 bits joined:  010011 010110 000101 101110
six-bit values:    19     22      5     46
alphabet:           T      W      F      u

"Man"  ->  "TWFu"

Drop the n and encode just "Ma" and you get "TWE=": two bytes fill three output characters, and one = marks the missing third byte. Encode a single "M" and you get "TQ==", with two pad characters. Nothing here is secret. Anyone who sees TWFu can run the same steps in reverse and read Man.

The part everyone gets wrong: it is not encryption

The confusion is understandable, because Base64 output looks scrambled to a human eye. But scrambled-looking is not the same as protected. Encryption depends on a key that the attacker does not have; Base64 depends on a published alphabet that everyone has. The HTTP Basic authentication header is the classic trap here. It Base64-encodes your username and password, which makes the header look opaque, yet it offers zero protection on its own. The only thing keeping those credentials safe is the TLS encryption of the connection around them, not the Base64.

When Base64 is the right tool

Base64 earns its place whenever binary data has to travel through a text-only channel:

  • Email attachments. MIME uses Base64 to carry images and files through mail systems that were originally designed for plain text only.
  • Data URIs. A small icon can be embedded directly in HTML or CSS as data:image/png;base64,... so it loads without a separate request. The image-to-Base64 conversion is exactly this.
  • Tokens and signatures. The three parts of a JSON Web Token are Base64url, so a JSON header and payload can ride inside a URL or an HTTP header safely.
  • Embedding bytes in JSON or XML. Those formats have no native binary type, so a raw file is Base64-encoded into a string field.

Standard Base64 vs the URL-safe variant

Two of the alphabet's characters, + and /, mean something special inside URLs, and = is reserved in query strings. To avoid breakage, the standard (RFC 4648) defines a URL-safe and filename-safe variant that swaps + for - and / for _, and often drops the trailing padding entirely. The two encodings are otherwise identical, so the only thing you must get right is using the same variant on both ends.

CharacterStandardURL-safe
Index 62+-
Index 63/_
Padding= usedoften omitted

Doing it privately

Because Base64 is reversible by anyone, the only privacy that matters when you encode or decode is where the work happens. A token payload, a certificate, or an embedded credential should not be pasted into a server you do not control. The Base64 Encoder runs the conversion locally with JavaScript, so the data never leaves your browser. The reference for the format itself is short and worth a look: the Base64 alphabet and its URL-safe variant are defined in RFC 4648.

Encode or decode Base64 nowEncode text to Base64 or decode Base64 back to text. UTF-8 safe with automatic direction detection.

Related articles