What Base64 is for
Base64 turns any bytes into plain text made of 64 safe characters (A-Z, a-z, 0-9, + and /). It is used to embed images in CSS or HTML (data: URLs), send binary data in JSON and email, and carry tokens such as the parts of a JWT.
Base64 is not encryption
Anyone can decode Base64. Never use it to hide passwords or secrets; it only changes the representation. It also makes data about 33% larger.
URL-safe variant
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant swaps them for - and _ and usually drops the trailing = padding. The decoder accepts both forms automatically.
Frequently asked questions
Why does decoding say "not valid UTF-8 text"?
The Base64 may hold binary data (an image or file) rather than text, so it cannot be displayed as characters.
Does it support emoji?
Yes. Text is encoded as UTF-8 first, so any character works.
What are the = signs at the end?
Padding that makes the length a multiple of 4. The URL-safe form omits it.