Base85 (Z85) encoder and decoder
Base85 packs binary data more densely than Base64: every four bytes become five printable characters. This tool uses Z85, the ZeroMQ variant, whose 85-character alphabet avoids quotes and backslashes so the output is safe to embed in source code and config files.
How it works
To encode, your text is converted to UTF-8 bytes and processed in 4-byte
groups. Each group is read as a 32-bit big-endian number, then expressed in
base 85 as five digits, each mapped to a Z85 alphabet character. Because the
encoding needs whole 4-byte groups, input whose length is not a multiple of four
is padded with zero bytes (the tool reports how many). Decoding takes each
5-character block, rebuilds the 32-bit value (value = value × 85 + digit),
and splits it back into 4 bytes.
Example
Encoding the 4-byte text Gera:
Gera→ bytes47 65 72 61→m}DZH
| Bytes (hex) | Z85 |
|---|---|
47 65 72 61 (Gera) | m}DZH |
86 4F D2 6F | Hello (the ZeroMQ Z85 test vector) |
Everything runs in your browser — your input never leaves the page.