BASE32 / 58 / 85
多进制编码,Base32 / 58 / 85 双向。
在文本与 Base32、Base58、Base85 之间双向转换。Base32 常用于密钥与 DNSSEC,Base58 用于比特币地址(去掉易混字符),Base85(Ascii85)用于 PDF / Git 二进制补丁。全部在浏览器本地按标准算法计算。
本页处理在浏览器本地完成
这是什么?
这些都是把二进制字节表示为可打印字符的编码:Base32 用 32 个字符、每 5 位一组(RFC 4648);Base58 用去掉 0/O/I/l 的 58 个字符、按大整数进制转换并保留前导零;Base85(Ascii85)每 4 字节编成 5 字符、全零组缩写为 z,比 Base64 更紧凑。
常见问题
Base58 和 Base64 有什么区别?
Base58 去掉了 0、O、I、l 等易混字符,且不使用 +、/ 与 = 填充,按大整数进制转换并保留前导零字节,更适合人工抄写(如比特币地址);Base64 是 6 位定长分组、更通用。
解码报错或乱码?
请确认编码与方向选择正确、字符属于对应字母表。Base85 解码会忽略空白并支持 <~ ~> 包裹;若原文不是合法 UTF-8 文本,解码结果可能显示为替换字符。
文件会上传吗?
不会。所有计算都在当前浏览器里完成,文本不会发送到任何服务器。
示例与注意事项Example & notes
一个例子A worked example
把 hello 编成 Base32 得到 NBSWY3DP(每 8 个字符一组、不足用 = 补齐);把方向切到「编码 → 文本」再粘回去,hello 又回来了。Encoding hello as Base32 gives NBSWY3DP (groups of 8, padded with =). Switch the direction to Encoded → Text, paste it back, and hello returns.
注意事项Things to watch
- Base32 按 RFC 4648 输出大写 A–Z 与 2–7,解码时小写会自动转成大写、空白会被忽略;但 0、1、8、9 根本不在字母表里,粘错就会直接失败。Base32 follows RFC 4648 with uppercase A–Z and 2–7. Decoding upper-cases lowercase input and ignores spaces, but 0, 1, 8 and 9 are simply not in the alphabet, so a typo fails immediately.
- Base58 字母表大小写敏感,并刻意删掉了 0、O、I、l 四个易混字符;手抄地址时把 l 写成 1 是最常见的解码失败原因。The Base58 alphabet is case-sensitive and drops the ambiguous 0, O, I and l. Copying l as 1 by hand is the most common reason a string fails to decode.
- Base85(Ascii85)里的 z 代表 4 个全零字节,输出可能含 ! 与 ~ 等符号;勾上「用 <~ ~> 包裹」就是 Adobe 变体,解码时两种写法都能识别。In Base85 (Ascii85) the letter z stands for four zero bytes and the output can contain characters such as ! and ~. Tick the <~ ~> wrapper for the Adobe variant; the decoder accepts either form.
- 这三种都是编码而不是加密,拿到结果的人都能还原原文;中文按 UTF-8 计算,一个汉字占 3 字节,编码后会明显变长。These are encodings, not encryption: anyone with the output can recover the original. Text is treated as UTF-8, so one Chinese character takes 3 bytes and the encoded string is noticeably longer.
相关问答More Q&A
Base32、Base58、Base85 我该选哪个?Which one should I use: Base32, Base58 or Base85?
看对方要求:要标准兼容选 Base32(RFC 4648,密钥与 DNS TXT 记录常见);要人工抄写选 Base58(比特币地址风格);要在有限篇幅里塞更多内容选 Base85(Git 二进制补丁、Adobe 格式)。Pick by context: Base32 (RFC 4648) for standard compatibility such as keys and DNS TXT records; Base58 when a human has to copy it, Bitcoin-address style; Base85 when you need the most content per character, e.g. Git binary patches and Adobe files.
解码后是乱码或问号,说明什么?What does garbled output after decoding mean?
多半是原内容不是合法 UTF-8 字节(比如本来就是二进制文件),或者字母表与方向选错了:先核对用的是 Base32 还是 Base58 字母表,再确认方向是「编码 → 文本」。Garbled output usually means the source bytes were not valid UTF-8 (raw binary, for instance), or the alphabet and direction were wrong. Check that you picked the right alphabet and that the direction is Encoded → Text.