Base91
Base91 is a scheme that encodes binary data into 91 printable ASCII characters, with an expansion of about 23% — more compact than Base64.
Purpose
It maximizes alphabet utilization while staying entirely within printable ASCII, reducing encoding overhead.
Mechanism
Every 13 bits of input map to two base-91 characters (91^2 = 8281 > 2^13 = 8192). Bits accumulate from the input, and once at least 13 bits are available a character pair is emitted; a final short group yields a single character.
Use cases
- Compact binary-to-text representation
- Binary embedding in data URIs
- High-density data encoding in QR codes
- Log and debug output
Examples
- Input
Hello WorldOutput>OwJh>Io0Tv!lEAbout 10% shorter than Base64
Common errors
- Assuming Base91 is a standardized encoding (it is a non-RFC proposal)
- Make sure both sides use the same implementation and alphabet
Related terms
Base64
Base64 maps arbitrary binary data onto 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) so that binary data can travel over text-only channels. GLOSSARY
Ascii85
Ascii85 (Base85) maps every 4 bytes (32 bits) to 5 ASCII characters, an expansion of about 25% — lower than Base64's 33% — and is used in PDF and PostScript. GLOSSARY
Base58
Base58 is a human-oriented binary-to-text encoding using 58 characters (dropping the easily confused 0, O, I, l, +, and / from Base64), best known for cryptocurrency addresses. GLOSSARY