What Base64 encoding is and when to use it
How Base64 turns bytes into safe ASCII, why the output grows by a third, and how base64url differs from the standard alphabet.
Turning bytes into safe text
Many systems were built to move text, not arbitrary bytes. Email bodies, JSON strings and URLs can choke on control characters or high-bit data, so a way to carry binary safely was needed. Base64 solves this by mapping every 6 bits of input to one of 64 printable characters: the letters A to Z and a to z, the digits 0 to 9, and the symbols plus and slash. The result contains only characters that survive text-only channels, which is why data URLs, JWTs and email attachments all lean on it.
The three-to-four ratio and padding
Base64 works in groups of 3 input bytes, which hold 24 bits, and splits them into four 6-bit chunks. Each chunk becomes one output character, so 3 bytes always produce 4 characters and the encoded string grows by roughly 33 percent. When the input does not divide evenly into threes, the final group is padded with equals signs so decoders know how many real bytes were present. That is why so much Base64 ends in a single or double equals sign.
Standard alphabet versus base64url
The classic alphabet uses plus and slash for its last two symbols, which is a problem in places where those characters have meaning. A slash breaks file paths, and both plus and slash must be percent-escaped in URLs. The base64url variant fixes this by swapping plus for hyphen and slash for underscore, and it usually drops the equals padding entirely. This tool produces standard Base64 by default and switches to base64url when you enable URL-safe, which is the form used inside JSON Web Tokens.
Why UTF-8 comes first
Base64 operates on bytes, not characters, so text has to become bytes before it can be encoded. This tool uses a UTF-8 encoder, the dominant web standard, so a plain letter becomes one byte while an emoji or a CJK character becomes several. Encoding UTF-8 first means the bytes are unambiguous and the string round-trips exactly, which is why an accented word like cafe encodes without loss and decodes back character for character.