What is Base64 — encoding explained simply
What is Base64: how binary-to-text encoding works, the URL-safe variant, and online encode/decode.
Base64 is an encoding of binary data into a text string using a 64-character alphabet: Latin letters, digits, “+”, and “/”. It lets you embed raw bytes safely in URLs, JSON, emails, and configs where binary data doesn't belong.
Encoding converts every three input bytes into four output characters, so a Base64 string is about one third longer than the source. If the length isn't a multiple of three, “=” padding is added. It is encoding, not encryption: anyone can decode the string back.
Base64 shows up in data URLs, SMTP, JWT segments, and file transfers in APIs. The URL-safe variant replaces “+” and “/” with “−” and “_” so the string doesn't break query parameters. Encoding passwords or secrets in Base64 is pointless — they stay readable.
The alphabet is A–Z, a–z, 0–9, + and /. Each character is 6 bits, so four characters carry three bytes. Padding with = fills a short final group. Base64url uses - and _ so the string can sit in a query. This page is the definition. Encoding your own text is the converter.
FAQ
What is URL-safe?
Uses −_ instead of +/, often without padding.
Does Base64 shrink data?
No, the opposite: the string is usually about one third longer than the source.
