User Rating 0.0
Total Usage 0 times
0 characters
0 bytes
Is this tool helpful?

Your feedback helps us improve.

About

Base85 encoding maps 4 binary bytes to 5 printable ASCII characters, achieving roughly 25% overhead versus the 33% of Base64. Three major variants exist: ASCII85 (used in Adobe PostScript and PDF streams, wrapped in <~ and ~> delimiters), Z85 (designed by ZeroMQ to be safe inside quoted strings), and RFC 1924 (proposed for compact IPv6 representation). Each variant uses a distinct 85-character alphabet, so feeding data encoded in one variant into a decoder configured for another produces garbage or fails silently. This tool validates input against the selected alphabet before decoding and reports exact character positions of any violations.

The decoding math is identical across variants: a group of 5 encoded characters is treated as a base-85 number, converted to a 32-bit unsigned integer, then split into 4 output bytes. Final groups shorter than 5 characters are right-padded with the highest alphabet character (u for ASCII85, % for Z85) before conversion, and excess output bytes are trimmed. ASCII85 also defines a special z shortcut representing four zero bytes. Incorrect padding or stray whitespace in the input are the most common sources of corrupted output. This converter strips whitespace and optional delimiters automatically, but preserves your data integrity by refusing to silently skip invalid characters.

base85 ascii85 z85 decoder text converter encoding binary to text

Formulas

Each group of 5 encoded characters is decoded into 4 binary bytes using positional base-85 arithmetic:

value = c0 × 854 + c1 × 853 + c2 × 852 + c3 × 85 + c4

where ci is the index of the i-th character in the variant's 85-character alphabet. The resulting 32-bit unsigned integer is then split into 4 bytes (big-endian):

byte0 = (value >> 24) & 0xFF
byte1 = (value >> 16) & 0xFF
byte2 = (value >> 8) & 0xFF
byte3 = value & 0xFF

For a final group with n encoded characters where 2 n < 5, the group is right-padded to length 5 with the highest-value alphabet character (index 84). After decoding, only n 1 output bytes are kept. The maximum decodable 32-bit value is 855 1 = 4,437,053,124, which exceeds 232 1 = 4,294,967,295. Any group decoding to a value above 232 1 is an encoding error.

Reference Data

PropertyASCII85 (Adobe)Z85 (ZeroMQ)RFC 1924
Alphabet Range! to u (0x21-0x75)0-9, a-z, A-Z, .-:+=^!/*?&<>()[]{}@%$#0-9, A-Z, a-z, !#$%&()*+-;<=>?@^_`{|}~
Alphabet Size858585
Encoded Group Size5 chars5 chars5 chars
Decoded Group Size4 bytes4 bytes4 bytes
Overhead vs Raw Binary25%25%25%
Overhead of Base6433%33%33%
Space Savings over Base646.7%6.7%6.7%
Zero-block Shortcutz4×0x00NoneNone
Delimiters<~ ... ~>NoneNone
Whitespace HandlingIgnored between delimitersNot allowedNot allowed
Padding Characteru (value 84)% (value 84)~ (value 84)
Max 32-bit Value Encoded4,294,967,295 (8551)4,294,967,2954,294,967,295
Common Use CasePDF, PostScript streamsZeroMQ binary framesIPv6 address encoding
SpecificationAdobe PostScript Ref. ManualZeroMQ RFC 32RFC 1924 (April 1996)
String-Safe (No Quotes)No (contains ' and ")YesNo
URL-SafeNoNoNo

Frequently Asked Questions

The two variants use entirely different alphabets. ASCII85 uses characters from ! (0x21) to u (0x75), while Z85 uses an unrelated set. Characters valid in one alphabet may map to a different numeric index in the other, producing corrupted output. Worse, some ASCII85 characters don't exist in the Z85 alphabet at all, causing immediate validation errors. Always verify which variant was used to encode your data before decoding.
In ASCII85, a standalone z character outside a 5-character group represents four consecutive zero bytes (0x00 0x00 0x00 0x00). The decoder recognizes z only when it appears where a new 5-character group would begin. A z embedded within a partial group is a format error. Z85 and RFC 1924 do not support this shortcut.
A group of 5 Base85 characters can represent values up to 855 1 = 4,437,053,124, but valid decoded output must fit in a 32-bit unsigned integer (max 4,294,967,295). Any group whose decoded value exceeds 232 1 indicates corrupted or improperly encoded input. The tool reports this as an overflow error rather than producing incorrect bytes.
Yes. Base85 encodes arbitrary binary data. When the decoded bytes are not valid UTF-8 text, the tool will still decode them and display them using the Unicode replacement character for non-printable bytes. Use the Download button to save the raw binary output as a file, which preserves every byte exactly as decoded regardless of text encoding.
For ASCII85, the specification allows whitespace (spaces, tabs, newlines) between the <~ and ~> delimiters - the decoder strips it automatically. For Z85 and RFC 1924, whitespace is technically not part of the specification. This tool strips leading and trailing whitespace for all variants and removes internal line breaks for convenience, but logs a notice if whitespace was found in Z85 or RFC 1924 input.
A single encoded byte requires 2 Base85 characters (producing 1 output byte). A single character alone is ambiguous - it maps to zero output bytes after the padding and trim logic - and is treated as an error. An empty input (or ASCII85 input containing only <~ and ~>) decodes to zero bytes, which is valid but trivial.