Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, and the symbols + and /. Every 3 bytes of input become 4 characters of Base64 output — which is why encoded data is always about 33% larger than the original.
Base64 is not encryption. Anyone can decode a Base64 string instantly — it provides no security. Its sole purpose is encoding: converting binary data into a format that can pass through systems designed to handle text, such as email, JSON APIs, or HTML attributes.
The URL-safe variant replaces + with - and / with _ to avoid conflicts with URL special characters — this variant is used in JWTs and web-safe data URLs.