A way to carry binary data as text

Base64 is an encoding (not encryption) that represents binary data using 64 ASCII characters (A-Z a-z 0-9 + /). It is used for email attachments (MIME), embedding binary in JSON, HTTP Basic Auth, inline images via data URIs and transporting JWT segments. Every 3 bytes of binary become 4 Base64 characters, so output is roughly 33% larger than the input.

Important: Base64 is not encryption. Anyone can reverse it — there is no key. To protect secrets use real cryptography such as AES, TLS or bcrypt. For API design guidance see our REST API security guide.

About Base64

No. Base64 is only an encoding — a reversible transform that anyone can decode without a key. For confidentiality use proper cryptography such as AES or ChaCha20, or transport-level TLS/HTTPS.

Standard Base64 characters `+`, `/` and `=` have special meaning in URLs and filenames. The URL-safe variant (RFC 4648 §5) swaps `+` for `-`, `/` for `_`, and strips padding `=`. JWT and many token formats use this variant.

A data URI embeds a resource directly inside a URL: `data:image/png;base64,...`. Handy for small icons and email templates where you want to eliminate HTTP requests. But the payload grows ~33%, browser caching is lost, and it is not recommended for files larger than ~10 KB.

Every 3 bytes of binary (24 bits) map to 4 six-bit Base64 characters — that is 4/3, about 33% larger. Padding adds a tiny extra overhead. 1 MB of binary produces roughly 1.37 MB of Base64 text.

Need API integrations?

KEYDAL delivers end-to-end services for REST and GraphQL API design, integration and security.

WhatsApp