Base45 encoder and decoder — the RFC 9285 encoding for QR codes

Encode text as Base45, the encoding defined in RFC 9285 for data stored in QR codes, or decode a Base45 string. Invalid characters and out-of-range groups are reported with their position.

Live demo · real result from this tool
Direction

Encoded

%69 VD92EX0

Processed on your device — nothing is uploaded.

How to use the Base45 tool

  1. Set Direction to Encode or Decode.
  2. Paste your text or Base45 string into Input. Keep any spaces inside a Base45 string exactly as they are.
  3. Copy the Encoded or Decoded result. If the decoded bytes are not text, they are shown as hex.

What it does and when to use it

Base45 is a recent IETF standard, published as RFC 9285 in 2022, designed for one job: putting binary data into QR codes efficiently. Its 45-character alphabet matches the QR alphanumeric mode, which packs two characters into 11 bits.

Use the decoder to inspect a Base45 payload from a QR code, for example during development or testing. Use the encoder to prepare data before you generate a QR code with the QR code generator, or to check your own implementation against the RFC examples.

Payloads in real systems are often compressed and signed before Base45 encoding, so the decoded result may be binary and show as hex. For other text encodings, compare Base32, which is case-insensitive, and Ascii85, which is denser.

How it works

Base45 reads the input two bytes at a time, as defined in RFC 9285, section 4:

  1. Two bytes form a number n = (a × 256) + b, between 0 and 65,535.
  2. That number is written as three Base45 digits c, d, e with n = c + (d × 45) + (e × 45 × 45), lowest digit first.
  3. If one byte is left over, it is written as two digits.

So every 2 bytes become 3 characters, 50% larger. The decoder reverses this and rejects any group worth more than 65,535 (or more than 255 for a final pair), as well as lengths that leave a single character over. Text is encoded as UTF-8. It all runs in your browser.

Worked examples

All four are taken from RFC 9285 or its rules, and computed by this tool:

AB          →  BB8
Hello!!     →  %69 VD92EX0
QED8WEX0    →  ietf!          (Decode)
GGW         →  Not valid Base45: the group at position 1 is out of range.

“AB” is bytes 65 and 66, so n = 65 × 256 + 66 = 16,706 = 11 + (11 × 45) + (8 × 2025), which gives the digits B, B, 8. In the last line, G, G, W stand for 16, 16 and 32, and 16 + 720 + 64,800 = 65,536, one more than two bytes can hold.

Limits and tips

  • Base45 strings may legitimately start or end with a space. Be careful when copying them from a document.
  • The decoder accepts upper-case letters only, as the RFC requires.
  • A length of 3n + 1 characters can never be valid Base45.

Frequently asked questions

Why use Base45 instead of Base64 in a QR code?
QR codes have an alphanumeric mode that stores 45 specific characters more compactly than general bytes. Base45 uses exactly those characters, so although the text is longer than Base64, the QR code that holds it can be smaller.
Which characters does Base45 use?
The digits 0–9, the capital letters A–Z, and nine symbols: space, $, %, *, +, -, ., / and colon. Lower-case letters are not part of the alphabet, so the decoder rejects them.
Why does the output contain spaces?
Space is one of the 45 characters, so it can appear in the middle of encoded data. In "%69 VD92EX0" the space is part of the value. Do not trim or collapse spaces in Base45 strings.
Where is Base45 used?
The best-known use was the EU Digital COVID Certificate, whose QR codes held compressed data encoded in Base45. It can be used for any binary data that has to fit into a QR code.
Is Base45 encrypted?
No. It is a public encoding without a key. Anyone with a decoder can read the bytes inside, although they may be compressed or signed data rather than plain text.

Sources

  1. RFC 9285: The Base45 Data Encoding — IETF / RFC Editor, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close