Base91 编解码工具
在浏览器中编码和解码 Base91 字符串——对于二进制数据比 Base64 更紧凑。
Base64 is ubiquitous but not optimal — it inflates data by 33%. Base91 is a lesser-known encoding that achieves better density by using a 91-character alphabet, typically producing output 10–15% smaller than the equivalent Base64 string. For applications where every byte counts — embedded payloads, URL-embedded data, or bandwidth-constrained channels — Base91 is worth reaching for.
This tool encodes arbitrary text or binary data to Base91 and decodes Base91 strings back to their original form. It is useful for developers working on data serialisation in constrained environments, anyone exploring alternative encodings for educational purposes, or security researchers analysing obfuscated payloads that may use non-standard encodings.
如何在线进行 Base91 编解码
- 1
粘贴您的输入内容
将纯文本或 Base91 编码的字符串粘贴到输入面板中。
- 2
选择编码或解码
选择编码以生成 Base91 字符串,或选择解码以恢复原始数据。工具会报告任何无效字符。
- 3
复制结果
复制输出。Base91 输出通常比等效的 Base64 小 8-10%。
How Base91 Encoding Works
Base91 was designed by Joachim Henke to maximise encoding efficiency while using only printable ASCII characters safe for use in most text contexts. It works by processing the input bitstream in 13-bit chunks rather than the 6-bit chunks used by Base64. Two output characters encode 13 bits rather than 6 bits per character, achieving a theoretical expansion ratio of about 1.23× versus Base64's 1.33×. The 91-character alphabet deliberately excludes characters that cause problems in common contexts — no single or double quotes, no backslash, no angle brackets.
Because 91 is not a power of two, the encoding algorithm uses a modular arithmetic trick rather than simple bit masking, which makes it slightly more complex to implement but delivers the efficiency gain. Decoders must handle the tail of the input carefully when the total bit count is not a multiple of 13.
为什么使用 FileCrank Base91 编解码工具?
- ✓ 输出比 Base64 小约 8-10%。
- ✓ 使用 91 个可打印 ASCII 字符,兼容性最大。
- ✓ 验证输入并清晰报告无效字符。
- ✓ 完全在浏览器中运行——不向任何服务器发送数据。
功能与规格
常见问题
什么是 Base91,它与 Base64 有何不同?
Base91 使用 91 个可打印 ASCII 字符,比 Base64 更高效地编码数据——每个输入字节约 1.23 个字节,而 Base64 为 1.33——使输出约小 8-10%。
何时使用 Base91 而不是 Base64?
当二进制数据的 ASCII 紧凑表示很重要,且接收系统支持 Base91 解码时,使用 Base91。它在标准协议中并不常见。如有疑问,请使用 Base64。
Base91 可以编码任意二进制数据吗?
可以。Base91 可以编码任何字节序列,生成适合在大多数纯文本系统中传输的可打印 ASCII 字符串。
Base91 与 Base85 或 Base92 相同吗?
不同。Base85(Ascii85)使用 85 个可打印字符,用于 PDF。Base91 使用 91 个可打印字符。Base92 是另一种不太常见的方案。对于相同输入,每种方案产生不同的输出。
Base91 vs. Base64 vs. Base85
Base64 is supported everywhere and should remain the default for interoperability. Base85 (used in PDF and git binary patches) is also more compact than Base64 but uses characters that can conflict with shell and XML contexts. Base91 strikes a middle ground — better density than Base64, a safer alphabet than Base85, but with almost no standard library support. Use Base91 when you control both encoder and decoder and want compact printable output.
相关工具
FileCrank Base91 编解码工具以 Base91 格式编码和解码数据,输出比 Base64 紧凑约 8-10%,完全在浏览器中运行。
Advertisement