What is Base64?
Base64 is an encoding scheme that converts binary data into ASCII characters. It's not encryption — anyone can decode it. It's used to safely transmit data over channels that only support text, like email or URLs.
Common Uses of Base64
- Email attachments — MIME encoding uses Base64 to attach files in emails.
- Data URLs — Embed images directly in HTML/CSS as
data:image/png;base64,… - API tokens — Many API keys and JWT tokens are Base64-encoded.
- URL-safe Base64 — Replaces
+with-and/with_to be safely embedded in URLs without encoding. - Basic Auth — HTTP Basic Authentication sends credentials as Base64:
username:passwordencoded.