What is Base64?

Base64 is a way to represent binary data using only 64 safe ASCII characters: A–Z, a–z, 0–9, + and / (with = as padding). It exists because many channels — email, JSON, URLs, XML — were designed for text and mangle raw bytes. Base64 smuggles any file through a text-only pipe intact.

How it works

Every 3 bytes (24 bits) of input are split into four 6-bit chunks, and each 6-bit value (0–63) maps to one character of the alphabet. Three bytes in, four characters out — which is why Base64 output is always about 33% larger than the original. When input length isn't divisible by 3, = padding fills the final group.

Where you meet it every day

The two classic mistakes

Base64 vs Base64URL

Standard Base64 uses + and /, which clash with URL syntax. Base64URL swaps them for - and _ and usually drops padding — that's the variant JWTs use.

Try it

The Base64 Fast converter encodes and decodes as you type, handles Unicode correctly, and turns any file or image into a ready-to-paste data URI — all without your data leaving the browser.