User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
📄 Drop file here
Supports RFC 9285 Base45. HC1: prefix is auto-stripped.
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Base45 is a binary-to-text encoding scheme defined in RFC 9285, designed to represent arbitrary byte sequences using a 45-character alphabet optimized for QR code alphanumeric mode. It gained prominence as the encoding layer in EU Digital COVID Certificates (EU DCC), where a compressed CBOR/COSE payload is Base45-encoded before being rendered as a QR code. Incorrect decoding - wrong character mapping, mishandled padding, or ignoring the triplet/pair structure - produces corrupted output that silently breaks downstream CBOR parsing. This tool implements the full RFC 9285 decode pipeline with strict validation: character set enforcement, length parity checks, and value-range verification at each decode step.

The encoding efficiency of Base45 is approximately 2.0 input bytes per 3 output characters, yielding a data expansion factor of roughly 1.5ร—. This is less compact than Base64 (1.33ร—) but optimal for QR alphanumeric mode, which encodes 2 characters in 11 bits. Attempting Base64 in a QR code forces byte mode, which costs 8 bits per character - making Base45 the superior choice for that specific transport. This tool approximates decoded output as UTF-8 text; binary payloads (e.g., compressed ZLIB streams) will display as raw bytes. For EU DCC data, the decoded output typically begins with a ZLIB header (0x78) and requires further decompression.

base45 decoder text converter RFC 9285 encoding QR code EU DCC

Formulas

Base45 decoding operates on groups of characters. A triplet of Base45 characters decodes to 2 bytes. A trailing pair decodes to 1 byte. The string length must satisfy len mod 3 โ‰  1.

For a triplet (c0, c1, c2):

n = c0 + c1 ร— 45 + c2 ร— 452

Constraint: n โ‰ค 65535 (i.e., 216 โˆ’ 1)

Decoded bytes: byte0 = n รท 256 (integer division), byte1 = n mod 256

For a trailing pair (c0, c1):

n = c0 + c1 ร— 45

Constraint: n โ‰ค 255

Decoded byte: byte0 = n

Where ci is the integer value (0 - 44) of the i-th character in the Base45 alphabet. The total output length in bytes is: 2 ร— floor(len รท 3)1 + (1 if len mod 3 = 2, else 0).

Reference Data

CharacterValueCharacterValueCharacterValue
00F15U30
11G16V31
22H17W32
33I18X33
44J19Y34
55K20Z35
66L21(space)36
77M22$37
88N23%38
99O24*39
A10P25+40
B11Q26-41
C12R27.42
D13S28/43
E14T29:44

Frequently Asked Questions

Base45 encodes arbitrary bytes, not exclusively text. In EU Digital COVID Certificates, the Base45 payload is a ZLIB-compressed CBOR structure. Decoding Base45 yields compressed binary data starting with byte 0x78 (ZLIB header). You would need to decompress the output first, then parse the CBOR. This tool decodes the Base45 layer faithfully; interpreting the resulting bytes as UTF-8 text is only meaningful if the original data was plain text.
A valid Base45 string must have a length where len mod 3 equals 0 or 2. A length where len mod 3 equals 1 is structurally invalid - there is no valid encoding that produces a single trailing character. This typically indicates truncation or corruption during copy-paste. Verify the complete string was captured, including any trailing characters like colons or digits.
Base64 encodes 3 bytes into 4 characters (expansion factor 1.33ร—). Base45 encodes 2 bytes into 3 characters (expansion factor 1.5ร—). Base45 is less dense. However, QR codes in alphanumeric mode encode 2 characters in 11 bits, while byte mode uses 8 bits per character. Base45's 45-character alphabet fits entirely within QR alphanumeric mode, yielding 5.5 bits per character versus Base64's 8 bits per character in byte mode. Net result: Base45 uses fewer QR modules for the same payload.
No. The Base45 alphabet defined in RFC 9285 includes only uppercase A - Z, digits 0-9, and nine special characters: space, $, %, *, +, -, ., /, and colon. Any lowercase letter in the input is invalid and will trigger a decoding error. If your source contains lowercase, it may have been corrupted or is not Base45-encoded.
A triplet (cโ‚€, cโ‚, cโ‚‚) computes to cโ‚€ + cโ‚ร—45 + cโ‚‚ร—45ยฒ = cโ‚€ + 45ยทcโ‚ + 2025ยทcโ‚‚. The maximum character value is 44, so the theoretical maximum is 44 + 44ร—45 + 44ร—2025 = 44 + 1980 + 89100 = 91124. However, the decoded value must fit in 2 bytes (โ‰ค 65535). Triplets yielding values above 65535 are invalid per RFC 9285 and indicate encoding corruption.
EU Digital COVID Certificates prepend the context identifier "HC1:" before the Base45 payload. This tool automatically detects and strips the HC1: prefix before decoding. The prefix is not part of the Base45 data itself - it is a transport-layer identifier defined in the EU eHealth Network specification. If present, it is removed silently; if absent, decoding proceeds normally.