> qr-optimized | efficient | modern <

// Base45 encoding optimized for QR codes and digital certificates

[QR-OPTIMIZED]

QR Code Efficient

Specifically designed for optimal QR code density and scanning reliability.

[MODERN]

RFC 9285 Standard

Follows the official Base45 standard used in EU Digital COVID Certificates.

[COMPACT]

Space Saving

More efficient than Base32 for QR codes while maintaining readability.

>> technical info

How Base45 Works:

Base45 uses 45 characters optimized for QR code Alphanumeric mode. It encodes data in groups of 2 bytes into 3 characters, achieving better efficiency in QR codes.

Example:

"Hello" → %69 VD92EX0

Why Use Base45:

  • >Optimized for QR code density
  • >EU Digital Certificate standard
  • >Better than Base64 for QR codes
  • >Reduces QR code complexity
  • >Improves scanning reliability

>> frequently asked questions

What is Base45 encoding?

Base45 is an encoding scheme that uses 45 characters specifically chosen to work efficiently with QR code Alphanumeric mode, as defined in RFC 9285.

Why was Base45 created?

Base45 was created to optimize data storage in QR codes, particularly for the EU Digital COVID Certificate. It's more efficient than Base64 when encoded in QR codes.

How is Base45 different from other encodings?

Base45 uses exactly the characters supported by QR code Alphanumeric mode, making it 20-30% more efficient than Base64 when stored in QR codes.

Where is Base45 commonly used?

Base45 is primarily used in digital health certificates, EU Digital COVID Certificates, and other applications where data needs to be efficiently encoded in QR codes.

Which 45 characters does Base45 use? (RFC 9285 alphabet)

Base45 uses exactly the characters in QR code Alphanumeric Mode:
0 1 2 3 4 5 6 7 8 9
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
(space) $ % * + - . / :
That's 10 digits + 26 letters + 9 symbols = 45 characters. QR codes store these at 5.5 bits per character (vs 8 bits for byte mode), so Base45 packs more data per QR module than Base64 would. The encoding works in pairs: every 2 bytes of input become 3 Base45 characters; a final odd byte becomes 2 characters.

How do I encode/decode Base45 in code?

Base45 is newer than most encodings (RFC 9285, July 2022) — library support is still catching up:
Python: pip install base45import base45; base45.b45encode(b'Hello')b'%69 VD92EX0'.
JavaScript: npm i base45.
Go: github.com/minvws/base45-go.
Rust: base45 crate.
C#: NuGet Base45.
Java: dev.zxilly:base45-java (maintained by EU DCC working group).
All implementations follow RFC 9285 exactly — encoded payloads are portable across tools and QR scanners.

Why is Base45 better than Base64 for QR codes?

A QR code storing Alphanumeric Mode uses only 5.5 bits per character; Byte Mode (needed for Base64's +//) uses 8 bits per character. For the same 256-byte payload:
Base64 in Byte Mode: 344 characters × 8 bits = 2752 bits → Version 13 QR (69×69).
Base45 in Alphanumeric Mode: 393 characters × 5.5 bits = 2161 bits → Version 11 QR (61×61).
Despite producing more characters, Base45 uses ~20% fewer QR modules because each character is stored more densely. Smaller QR codes scan faster, print better at low resolution, and fit in more layouts. This is exactly why the EU Digital COVID Certificate team chose Base45 for vaccination QR codes.

Base45 in EU Digital COVID Certificate — how does the full pipeline work?

The EU DCC (Digital Green Certificate) pipeline is a great real-world example of layered encoding:
1. Health data → encoded as CBOR (Concise Binary Object Representation, RFC 8949).
2. CBOR → wrapped in COSE_Sign1 with the issuing country's signature.
3. COSE → compressed with zlib / DEFLATE.
4. Compressed bytesBase45 encoded.
5. Base45 string → prefixed with HC1: and rendered as a QR code.
To decode someone's certificate, you reverse each step. The HC1: prefix is the "version" identifier — the Base45 string between HC1: and the QR end is what our tool can decode.

How long is a Base45 string vs the original bytes?

Base45 encodes every 2 input bytes into 3 output characters (a single trailing byte produces 2 characters). So the overhead is:
n bytes input⌈n × 3/2⌉ characters output.
• Size ratio: ~1.5×, or 50% overhead.
That's worse than Base64 (33%) in terms of raw character count — but what matters for QR is bits per QR module, where Base45 wins by using Alphanumeric Mode. For non-QR contexts (JSON, URLs, storage), Base64 or Base64url remain more efficient.

Can I use Base45 outside QR codes?

Yes, but there's rarely a reason to. The 45-character alphabet was designed for QR's Alphanumeric Mode, not for URLs, JSON, or filenames. Notable: Base45 includes space (0x20) and /, making it unsafe in URL paths and bare shell arguments. Outside of QR encoding, prefer:
Base64url — URL-safe, 33% overhead.
Base62 — strictly alphanumeric.
Base58 — avoids look-alikes, used by Bitcoin.
Base45's niche is specifically "encode binary into a QR code as efficiently as possible while remaining scanner-compatible" — for that, it's best-in-class.

Other Languages