Z85 Encoder
Enter text to encode it as a Z85 (ZeroMQ base-85) string.
Result
How it is calculated
The text is read as raw UTF-8 bytes. If the byte count is not a multiple of 4, zero bytes (0x00) are appended until it is. Each 4-byte group is read as one big-endian 32-bit number V = b1·256³ + b2·256² + b3·256 + b4, which is then written as five base-85 digits, most significant first: V = d1·85⁴ + d2·85³ + d3·85² + d4·85 + d5. Each digit 0 to 84 is replaced by the character at that position in the Z85 alphabet, which starts 0-9, a-z, A-Z and then punctuation (.-:+=^!/*?&<>()[]{}@%$#). The output shows the padding added, so you know the encoded string is longer than the original data. Empty input returns nothing. The padding is not marked in the output, so a decoder cannot tell it from real zero bytes.
Worked example
Input Hello is 5 bytes, so 3 zero bytes are added to reach 8. Group 1 is "Hell" = 0x48656C6C = 1,214,606,444, which in base 85 gives the digits 23, 22, 66, 52, 49 and the characters nm=QN. Group 2 is "o" plus three zero bytes = 1,862,270,976, digits 35, 57, 33, 65, 26 and the characters zVx+q. Joined: nm=QNzVx+q, with 5 bytes (8 after padding) and 3 zero bytes of padding.
Common mistakes
- Expecting the output to be reversible to exactly the original text: the zero padding is not marked, so decoding gives the padded bytes back, with trailing NUL characters.
- Counting characters instead of bytes: accented or non-Latin letters take 2 to 4 bytes in UTF-8, so "ğ" is 2 bytes and changes the length and padding.
- Confusing Z85 with the Ascii85 (Adobe) or base85 of Python and git: the alphabets differ, so the strings are not interchangeable.
- Treating the encoding as encryption. It is a reversible representation with no secrecy at all.
- Pasting a ZeroMQ key and expecting it to be unchanged; Z85 keys are already encoded, so encoding them again produces a different, longer string.
About this calculator
Z85 is the base-85 binary-to-text encoding defined by the ZeroMQ project's ZMTP/spec:32 specification, designed to pack binary data into printable ASCII more densely than base64: base64 expands data by roughly 33%, while Z85's 85-symbol alphabet expands it by only 25%, encoding every 4 bytes of input into exactly 5 output characters.
Because that 4-byte grouping is fixed, Z85 requires the input length to be a multiple of 4 bytes, so encoders zero-pad shorter inputs before converting. Z85 is best known as the encoding ZeroMQ itself uses for its CURVE security public and secret keys, making them safe to print, log, or paste as plain text.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Z85 turns every four bytes into five characters, so the output is 25% longer than the input, and the preset Hello becomes 10 characters after padding to 8 bytes. The alphabet avoids quotes and backslashes, which suits source-code strings, but it includes the ampersand and the less-than and greater-than signs, so escape it in HTML or XML. Keep the padding count shown, since a decoder needs it. Where do you plan to embed the output?