Base64 Encoder and Decoder
Base64 encodes arbitrary binary data as ASCII text, so it can travel through channels that only reliably carry printable characters, such as email bodies, JSON string fields, HTTP headers, and data URIs.
How it works
Base64 reads the input three bytes (24 bits) at a time and re-splits those bits into four 6-bit groups. Each group indexes a 64-character alphabet: A-Z, a-z, 0-9, then + and /. Because four output characters represent three input bytes, encoded data is roughly 33% larger than the original. When the input length is not a multiple of three, the output is padded with = so the total length stays a multiple of four.
URL-safe Base64
The standard alphabet's + and / both have meaning inside URLs, so RFC 4648 defines a URL-safe variant substituting - and _. JSON Web Tokens use this variant and usually drop the = padding entirely. Decoding a URL-safe string with a standard decoder is a common and confusing source of failure.
Base64 is not encryption
Base64 is an encoding, not a cipher. It provides no confidentiality whatsoever — anyone can decode it instantly and without a key. Treat Base64-wrapped credentials as plaintext. HTTP Basic authentication, for instance, is simply user:password in Base64, which is why it is only safe over TLS.