How to use the Z85 tool
- Set Direction to Encode or Decode.
- Set Bytes from to Text (UTF-8) or Hex.
- Paste your input. For encoding, the byte count must divide by 4; for decoding, the character count must divide by 5.
- Copy the result. With Hex selected, decoded output is shown as hex bytes.
What it does and when to use it
Z85 is a Base85 encoding published by the ZeroMQ project as RFC 32. It was designed to write binary keys as short text that can be embedded in program source code, configuration files and command lines without any escaping.
Use it to convert a ZeroMQ CURVE key between hex and Z85, to check the output of your own Z85 implementation, or to encode any fixed-size binary value compactly. Z85 adds 25% to the size, less than Base64’s 33%.
If your data length is not a multiple of 4 and you control the format, Ascii85 handles any length. For values that go into URLs, Base64URL is the usual choice, and Base58 avoids look-alike characters for human copying.
How it works
The rules come from ZeroMQ RFC 32:
- The bytes are read four at a time as a 32-bit number, most significant byte first.
- Each number is written as five base-85 digits, most significant first.
- Each digit picks a character from the Z85 alphabet:
0–9,a–z,A–Z, then.-:+=^!/*?&<>()[]{}@%$#.
Decoding reverses this, checks that every character is in the alphabet and that no 5-character group is worth more than a 32-bit number can hold. Spaces and line breaks in the input are ignored. Everything runs in your browser.
Worked examples
86 4F D2 6F B5 59 F7 5B (Hex) → HelloWorld
HelloWorld (Decode, Hex) → 86 4f d2 6f b5 59 f7 5b
Hello world! (Text) → nm=QNzY<mxA+]nf
abc (Text) → Z85 needs a byte length that is a multiple of 4;
this input is 3 bytes (1 short of the next multiple).
The first line is the test vector from the specification: those 8 bytes spell “HelloWorld” in Z85. “Hello world!” is 12 bytes, so it encodes to 15 characters. “abc” is 3 bytes and is refused.
Limits and tips
- To encode text whose length is not a multiple of 4 bytes, add padding yourself and agree with the receiver how to remove it.
- Remember that accented letters and emoji take 2 to 4 bytes in UTF-8, so the byte count may differ from the character count.
- Z85 output can contain characters such as
<,>and&. Escape them if you place a Z85 string inside HTML or XML.
Frequently asked questions
Why must the input be a multiple of 4 bytes?
How is Z85 different from Ascii85?
Where is Z85 used?
When should I choose Hex for "Bytes from"?
Does Z85 keep my key secret?
Sources
- 32/Z85 — ZeroMQ Base-85 Encoding Algorithm — ZeroMQ RFC, accessed 2026-10-08
How do we know nothing is uploaded? Test it yourself on the privacy proof page.