Using Base64 Encoder: practical guide
What Base64 is and is not
Base64 represents binary or text data using 64 safe characters so it can travel through systems that only handle plain text, such as JSON fields, email and data URLs. It is an encoding, not encryption: anyone can decode it, so never use it to hide secrets.
Expect about one-third growth
Every 3 bytes of input become 4 characters of output, so encoded data is roughly 33% larger. Output length is padded with = characters to a multiple of 4. The URL-safe variant swaps + and / for - and _ so the value can sit in a link.
Why decoding fails
The usual causes are a truncated string, characters outside the Base64 alphabet, or URL-safe text decoded as standard Base64. Extra spaces and line breaks are ignored, but a missing character is not recoverable. Everything runs in your browser.