Glossary
Base64
Binary-to-text encoding
Base64 is an encoding scheme that represents arbitrary binary data using 64 ASCII characters: the uppercase letters A-Z, the lowercase letters a-z, the digits 0-9, and the symbols + and /. Padded with the = character to a multiple of 4 bytes. Defined in RFC 4648.
Three input bytes encode to four Base64 characters, so the encoded form is roughly 33% larger than the source. Encoding and decoding are both deterministic and exact — there’s no quality loss, just size inflation.
The primary use cases:
- Inlining binary data in text-only protocols. Email (MIME attachments), JSON (where binary fields aren’t allowed natively), data URIs in HTML/CSS.
- JWT (JSON Web Token). JWT payloads are Base64-encoded (specifically base64url, see below) to fit safely inside HTTP headers and URLs.
- Storing binary in databases or config files when the native column type would be awkward (e.g. SQLite BLOB columns are fine but require driver-level handling; a TEXT column holding Base64 is more portable).
Base64url is a variant defined in the same RFC that replaces + with - and / with _. These two substitutions make the encoded data URL-safe — neither - nor _ needs percent-encoding in a URL. JWT and modern web APIs use base64url throughout.
Encode or decode in your browser with our Base64 tool, which handles UTF-8 text correctly (the JavaScript btoa / atobprimitives don’t).
Related
Published May 14, 2026