What Base64 is for
Base64 turns any data, including images and files, into plain text made of letters, numbers, + and /. That lets binary data travel through systems that only handle text, such as JSON, email and HTML attributes.
It isn't encryption: anyone can decode it. It also makes data about a third larger, so use it for embedding small files, not for storing large ones.
- Data URLs: embed small images directly in HTML or CSS.
- APIs and tokens: many APIs and JWTs use URL-safe Base64.
- Email attachments: are Base64-encoded behind the scenes.