Home Tools Blog About

Base64 Cheat Sheet: Alphabet and How It Works

This Base64 cheat sheet explains the alphabet, the padding, and how encoding works. To encode or decode text and data, use the Base64 Encoder and Decoder.

What Base64 is

Base64 turns binary data into plain text using 64 safe characters, so files and bytes can travel through systems that only handle text, such as email, JSON, and data URLs. It is an encoding, not encryption: anyone can decode it.

The Base64 alphabet

The 64 characters map to the values 0 to 63.

RangeCharactersValues
UppercaseA to Z0 to 25
Lowercasea to z26 to 51
Digits0 to 952 to 61
Symbols+ and /62 and 63

The = character is padding, not part of the alphabet.

How encoding works

Base64 takes three bytes at a time, which is 24 bits, and splits them into four groups of six bits. Each six bit group, a value from 0 to 63, becomes one character from the alphabet. That is why Base64 output is about one third larger than the input. When the data does not divide evenly into three, one or two = characters pad the end.

URL safe Base64

Because + and / have special meaning in URLs, a URL safe variant replaces + with – and / with _, so the encoded value can sit in a link or filename without breaking.

Frequently asked questions

What characters does Base64 use?

A to Z, a to z, 0 to 9, plus + and /, for 64 characters, with = used only as padding.

Is Base64 encryption?

No. It is a reversible encoding that anyone can decode, so it does not protect data. Use encryption for that.

Why is Base64 larger than the original?

Because it uses four characters for every three bytes, the output is roughly 33 percent bigger than the input.

ATV

Written by Nick (ATV Team)

We build and maintain the 600+ free, client-side tools on this site, and every guide is written against the tools themselves: each figure is computed and checked before it is published, and every linked tool is tested in the browser. More about how we work on the about page, and the full library of guides lives on the blog.