User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Whitespace and line breaks are stripped automatically.
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

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.

base64 base45 converter encoding decoding RFC 9285 binary data QR code

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:

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

where c0, c1, c2 ∈ [0, 44]. For a trailing single byte, the value n ∈ [0, 255] is encoded into two digits:

n = c0 + c1 Γ— 45

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

PropertyBase64 (RFC 4648)Base45 (RFC 9285)
Alphabet size64 characters45 characters
Character setA - Z a - z 0-9 + /0-9 A - Z $ % * + - . / : & space
Padding character=None
Bits per character6β‰ˆ 5.49
Expansion ratio (bytes β†’ chars)4 chars per 3 bytes (1.33Γ—)3 chars per 2 bytes (1.50Γ—)
QR mode usedByte mode (8 bits/char)Alphanumeric mode (5.5 bits/char)
Effective QR cost per input byte10.67 bits8.25 bits
QR size advantageBaselineβ‰ˆ 23% smaller QR symbol
Primary use caseEmail (MIME), Data URIs, JWTEU DCC, ICAO VDS, QR payloads
Grouping unit3 bytes β†’ 4 chars2 bytes β†’ 3 chars
Trailing group1 - 2 bytes padded with =1 byte β†’ 2 chars
RFC statusStandards Track (2006)Informational (2022)
Case sensitivityYes (mixed case)No (uppercase only)
URL safe variantBase64url (- _ instead of + /)Not applicable
Whitespace handlingIgnored by most decodersMust be stripped before decoding
Null byte encodingAA==00
Max single-group value16,777,215 (224βˆ’1)65,535 (216βˆ’1)

Frequently Asked Questions

Base64 expands data by a factor of approximately 1.33Γ—, while Base45 expands by 1.50Γ—. However, QR codes support an Alphanumeric mode that encodes each character in only 5.5 bits. Base64 contains lowercase letters, forcing the more expensive Byte mode at 8 bits per character. The net cost per input byte is 8.25 bits for Base45 versus 10.67 bits for Base64, making the QR symbol roughly 23% smaller with Base45.
This converter auto-detects Base64url encoding. Characters - and _ are silently replaced with + and / respectively before decoding. Missing padding (=) is also restored automatically. The resulting bytes are then encoded into standard Base45.
Yes. The theoretical maximum for three Base45 characters is 44 + 44Γ—45 + 44Γ—45Β² = 91,124. However, since each group represents at most two bytes (0-65,535), any decoded value above 65,535 signals a corrupted or invalid input. This converter will reject such groups and display an error identifying the offending position.
No. EU DCC payloads typically start with the prefix HC1: followed by Base45-encoded ZLIB-compressed CBOR/COSE data. This tool performs the raw Base45 encoding or decoding only. Decompression and CBOR parsing are separate steps outside the scope of a format converter.
All whitespace characters (spaces, tabs, newlines, carriage returns) are stripped from the input before processing in both directions. This is consistent with common Base64 decoder behavior where MIME-encoded data contains line breaks every 76 characters. The Base45 specification does not define whitespace handling, but stripping is the safe default.
The converter processes data synchronously in the browser. Inputs up to approximately 100 KB of encoded text convert in under 50 ms on modern hardware. Larger inputs may cause brief UI lag. For payloads beyond 1 MB, consider a command-line tool with streaming support.