What Base64 is for
Base64 turns any data into plain letters, numbers and a few symbols so it can travel safely through systems that only handle text, such as email, JSON, URLs and HTML. It is used for email attachments, small images embedded in web pages, API keys in HTTP headers and JWT tokens.
Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
URL-safe Base64 and data URLs
URL-safe Base64 swaps + and / for - and _ and drops the = padding, so it can be used in web addresses and file names. The decoder accepts both forms. Encoding a file gives a data URL such as data:image/png;base64,…, which you can paste into an img tag or a CSS background.