How it works
Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /), turning every 3 bytes into 4 characters, so encoded data is about 33% larger. '=' padding fills the last group.
Text is converted to UTF-8 bytes first, so Indian-language text and emoji encode correctly. The URL-safe variant swaps + and / for - and _ and drops padding, as used in JWTs. Base64 is an encoding, not encryption; anyone can decode it.
Encoded length = 4 × ceil(bytes / 3)Worked example
The text 'CrimsonEdge' is 11 bytes and encodes to 'Q3JpbXNvbkVkZ2U=' (16 characters, one '=' of padding). Decoding that string gives back 'CrimsonEdge'.