Base45 Encoder/Decoder

Compact QR-code-friendly encoding used in EU COVID passes

Ad placeholder (leaderboard)

Base45 is a binary-to-text encoding defined in RFC 9285 that uses a 45-character alphabet chosen to fit the QR code alphanumeric mode. It is the encoding behind the EU Digital COVID Certificate, where it shrinks a signed, compressed payload into the smallest possible QR code. This tool encodes UTF-8 text into Base45 and decodes Base45 back, all in your browser.

How it works

Base45 processes the input two bytes at a time:

  1. Two bytes form a 16-bit number n (range 0 to 65535). That number is written in base 45 as three digits: c0 = n mod 45, c1 = (n / 45) mod 45, c2 = n / 2025. The digits are emitted least-significant first.
  2. A single leftover byte (range 0 to 255) is written as two base-45 digits: c0 = n mod 45 and c1 = n / 45.
  3. Each digit is mapped through the fixed alphabet 0-9 A-Z plus the symbols space $ % * + - . / :.

Decoding reverses this: groups of three characters rebuild a 16-bit value (two bytes), and a trailing group of two characters rebuilds one byte. A group of three must not exceed 65535, and a final pair must not exceed 255, or the input is rejected.

Tips and example

Encoding the text AB gives BB8, and encoding base-45 gives UJCLQE7W581 — both standard RFC 9285 test vectors. Because every two input bytes become three output characters, a Base45 string is about 50 percent longer than the raw bytes, but it still beats Base64 once it is rendered as a QR code. If you paste a Base45 string whose length leaves a remainder of 1 when divided by three, the tool flags it as malformed, since no valid encoding ever produces that shape.

Ad placeholder (rectangle)