The idea in plain English: Base64 is NOT encryption — it's a way to represent binary data (images, files, raw bytes) using only safe text characters (A-Z, a-z, 0-9, +, /). Why? Some systems (like email or JSON) can't handle raw binary data — they expect text. Base64 converts every 3 bytes into 4 text characters. To decode: convert the text characters back to bytes, and you get the original file or message.
Why this really exists: Email attachments use Base64 (that's what MIME encoding
is). When you upload an image to a website, the browser sends it as Base64 text inside JSON.
Data URLs like data:image/png;base64,... embed images directly in HTML using Base64.
If you've ever sent an email with a photo attached, you've used Base64.
The word "Man" encoded in Base64:
To decode "TWFu": convert each character to its 6-bit value (T=19, W=22, F=5, u=46), combine into 24 bits, split into 3 bytes, convert to characters → "Man".
1. The alphabet is: A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63)
2. Convert each Base64 character to its 6-bit index value
3. Group every 4 characters → 24 bits → split into 3 bytes (8 bits each)
4. Handle padding: "=" signs at the end mean there's less data
💡 In the website, the Base64 decode step is just the warm-up. The result is usually another encoded message layer (like XOR or Caesar) that reveals the actual answer. Base64 is often used as a first wrapper around other ciphertext.
data:image/png;base64,iVBOR... embeds images directly in web pages