Base91 Encoder/Decoder
Encode and decode text in Base91, a more compact format than Base64 because it packs more data into each printable ASCII character.
Base91
—
basE91: squeezing more data into printable text
basE91 uses 91 of the printable ASCII characters, against base64's 64, and with that the growth drops from 33% to roughly 23%. Its mechanics differ from the other bases: instead of grouping into fixed blocks, it accumulates bits in a register and emits two characters whenever 13 or 14 bits are available — the count varying according to whether the value fits in 13 bits.
Type the text and get the encoding. That 13-or-14-bit variation is what makes the format more efficient than base85, and also what makes it harder to implement correctly: an error in the threshold produces plausible, undecodable output. The implementation was checked against known vectors — "test" encodes to fPNKd and "a" to GB.
The price of that efficiency is the alphabet, which includes double quotes, the dollar sign, the backtick and other characters needing escapes in nearly every context: inside code strings, in URLs, in XML, in CSV. That is why basE91 shows up rarely in practice despite being measurably smaller than base64 — the saving seldom justifies the extra care in transport.
Frequently asked questions
Why 13 bits sometimes and 14 others?
Is it safe in a URL?
Is it worth it over base64?
Related Tools
Image to Base64
Convert images to Base64 strings for use in CSS, HTML or APIs. Supports PNG, JPG, GIF, SVG and WebP.
Base64 Converter
Encode text to Base64 or decode Base64 strings back to the original. Free online tool with no server required.
Punycode Encoder/Decoder
Convert IDN domains (with accents or non-ASCII characters) to Punycode (xn--...) and back. Useful for registering international domains and validating emails. Everything in your browser.
URL Encode / Decode
Encode text for safe use in URLs (percent-encoding) or decode URL-encoded strings back to the original. Processed in the browser.
Base32 Encoder / Decoder
Encode text to Base32 or decode Base32 strings back to the original.
Base58 Encoder / Decoder
Encode text to Base58 or decode Base58 strings back to the original. Used in cryptocurrencies like Bitcoin.