Base64 turns bytes into safe ASCII so data can cross text-only borders - email, headers, JSON, data URIs. The trick is that it must handle the bytes underneath correctly, not just the happy path.
Base64 Encoder / Decoder is unicode-safe, gives you the URL-safe alphabet, optional padding, MIME line wrapping and live stats.