Base64 is one of those terms that shows up everywhere — in data URIs, email attachments, JSON Web Tokens, API keys and config files — yet rarely gets explained clearly. This guide covers what Base64 actually is, how the encoding works, and the single most important thing to understand about it: Base64 is not encryption.
What Base64 is
Base64 is a way of representing binary data (any sequence of bytes) using only 64 printable ASCII characters: A–Z, a–z, 0–9, plus + and /. It exists because many systems — email, URLs, JSON — were designed for text and can mangle or reject raw binary bytes. Base64 lets you safely carry binary data through a text-only channel.
How the encoding works
Base64 takes your input three bytes (24 bits) at a time and splits those 24 bits into four groups of six bits. Each six-bit group (a value from 0 to 63) maps to one character in the Base64 alphabet. If the input length is not a multiple of three, the output is padded with one or two = characters. That is why Base64 output is always a multiple of four characters long, and why it is roughly 33% larger than the original.
You can watch this happen byte by byte with our Base64 encoder/decoder — type any text and the encoded form updates instantly.
Base64 is NOT encryption
This is the most common and most dangerous misconception. Base64 has no key and no secret. Anyone can decode it in a fraction of a second. It provides exactly zero confidentiality. If you need to protect data, use real encryption (such as AES) — and remember that putting a password or API secret in Base64 is the same as writing it in plain text. Base64 only changes the representation of data, never its security.
URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 swaps them for - and _ and usually drops the = padding. This is the variant used inside JSON Web Tokens. If you ever try to decode a JWT segment with a normal Base64 decoder and it fails, URL-safe encoding is usually the reason.
When you'll meet Base64
Common places: data URIs (embedding a small image directly in HTML/CSS), email attachments (MIME), HTTP Basic Auth headers, JWTs, and config files that need to store binary blobs as text. For raw byte inspection you may prefer hexadecimal instead, and for putting text into a query string you want URL percent-encoding, not Base64.
Try it yourself
The fastest way to understand Base64 is to play with it. Open the Base64 tool, type your name, and watch the output. Then decode it back. Everything runs in your browser — nothing is uploaded.