Base64 explained

Base64 shows up everywhere: email attachments, tokens, images embedded in HTML. Yet it's often misunderstood. Base64 is neither encryption nor compression: it's an encoding, a way to represent binary data using text.

The idea

A binary file holds bytes that don't always survive a text-only channel - an email body, a URL, some JSON. Base64 groups the bits into chunks of 6 and maps them with a 64-character safe alphabet (A-Z, a-z, 0-9, + and /). The result contains only printable characters, safe to carry around.

💡 Anecdote - URLs and JWTs use a variant, base64url, which swaps + and / for - and _ to stay safe inside an address.

The cost: about +33%

Encoding 3 bytes (24 bits) yields 4 characters: the output is roughly a third larger than the input. That's the price of portability. On a large image inlined as a data: URI, that overhead isn't trivial - weigh it against saving a network request.

When to use it (and when not)

Good for: inlining a small image or font in CSS/HTML, carrying a binary inside a text field, showing the decoded payload of a JWT. Useless, even dangerous, as "security": Base64 decodes instantly and protects nothing. To encode or decode a value without sending anything online, our Base64 tool does it all in your browser

🤓 Did you know? Base64 owes its existence to email: old SMTP servers carried only 7-bit text and couldn't move a binary file. Encoding attachments as Base64 solved it - and the method stuck.