Base64 to Base45 Converter
Convert Base64 encoded data to Base45 format and vice versa. Implements RFC 9285 Base45 encoding used in EU Digital COVID Certificates and QR payloads.
About
Base45 encoding (defined in RFC 9285) maps binary data into a 45-character subset optimized for Alphanumeric mode in QR codes. A naΓ―ve approach of encoding raw bytes as Base64 and then placing that into a QR code forces Byte mode, which costs 8 bits per character. Base45 uses Alphanumeric mode at 5.5 bits per character, producing smaller QR symbols despite a longer string. This tool decodes your Base64 input into its raw byte array, then re-encodes those bytes using the Base45 alphabet 0-9 A - Z $ % * + - . / : and space. Getting the conversion wrong means corrupted payloads, failed certificate verification, or unreadable QR codes. The tool also supports the reverse direction for inspection of Base45 data received from EU Digital COVID Certificates or ICAO visible digital seals.
Limitations: this converter treats the Base64 input as an opaque byte stream. It does not parse or validate the semantic content (e.g., CBOR, COSE) inside the payload. Padding characters (=) in Base64 are optional on input; the tool normalizes them automatically. Maximum recommended input size is approximately 100 KB of encoded text to keep the browser responsive.
Formulas
Base45 encoding converts a byte stream into groups. Each pair of bytes forms an unsigned 16-bit integer n, which is then decomposed into three Base45 digits:
where c0, c1, c2 β [0, 44]. For a trailing single byte, the value n β [0, 255] is encoded into two digits:
Each digit index maps to the character at that position in the Base45 alphabet string. Decoding reverses the arithmetic: parse groups of 3 characters (or trailing 2), look up each character's index, reconstruct n, then split into 2 bytes (or 1). The maximum value for a 3-character group is 44 + 44 Γ 45 + 44 Γ 452 = 91,124, but valid byte-pair values never exceed 65,535. Any decoded value above 65,535 indicates a malformed input.
Where n = combined unsigned integer from the byte pair, ci = Base45 digit (index into alphabet), 45 = the radix of the encoding system.
Reference Data
| Property | Base64 (RFC 4648) | Base45 (RFC 9285) |
|---|---|---|
| Alphabet size | 64 characters | 45 characters |
| Character set | A - Z a - z 0-9 + / | 0-9 A - Z $ % * + - . / : & space |
| Padding character | = | None |
| Bits per character | 6 | β 5.49 |
| Expansion ratio (bytes β chars) | 4 chars per 3 bytes (1.33Γ) | 3 chars per 2 bytes (1.50Γ) |
| QR mode used | Byte mode (8 bits/char) | Alphanumeric mode (5.5 bits/char) |
| Effective QR cost per input byte | 10.67 bits | 8.25 bits |
| QR size advantage | Baseline | β 23% smaller QR symbol |
| Primary use case | Email (MIME), Data URIs, JWT | EU DCC, ICAO VDS, QR payloads |
| Grouping unit | 3 bytes β 4 chars | 2 bytes β 3 chars |
| Trailing group | 1 - 2 bytes padded with = | 1 byte β 2 chars |
| RFC status | Standards Track (2006) | Informational (2022) |
| Case sensitivity | Yes (mixed case) | No (uppercase only) |
| URL safe variant | Base64url (- _ instead of + /) | Not applicable |
| Whitespace handling | Ignored by most decoders | Must be stripped before decoding |
| Null byte encoding | AA== | 00 |
| Max single-group value | 16,777,215 (224β1) | 65,535 (216β1) |