Guide
Ascii85 and Z85: binary data at 25 percent overhead
Base64 is everywhere, but it spends four characters on every three bytes, a one-third overhead. Ascii85, also called Base85, spends five characters on four bytes, which is one quarter. The saving is modest and the alphabet is bigger, so it is chosen where compactness matters and the text channel can take punctuation: PDF and PostScript files and a few binary protocols.
How it works
Take four bytes and read them as one 32-bit number. Divide it by 85 five times, collecting the remainders, and add each remainder to 33 to get a printable ASCII character between ! and u. Because 85 to the fifth power is bigger than 2 to the 32nd, five characters are always enough. In the Adobe variant, a group of four zero bytes is written as the single letter z instead of !!!!!, which makes data with many zeros shorter still.
Delimiters and the short group
PostScript and PDF wrap the data in <~ and ~>, with the closing marker also telling the decoder where the stream ends. The page can add and remove them. When the input length is not a multiple of four, the last group is padded with zeros before encoding and then trimmed, so n leftover bytes give n + 1 characters. The decoder pads a short group with u characters, which is the highest digit, and drops the extra bytes.
The Z85 variant
Z85, defined in ZeroMQ’s RFC 32, uses an alphabet of 85 characters picked to be safe inside source code: it leaves out the quote marks, the backslash and the grave accent. It has no z shortcut and no delimiters, and it requires the input to be a multiple of four bytes, which suits keys and fixed-size blocks. The Z85 option on the page enforces this and says so when the length is wrong.
Using the page
Choose encode or decode, select Ascii85 or Z85, and pick whether the input is text or hex. For Adobe output you can switch the <~ ~> wrapper on. The page shows how many bytes went in and how many characters came out, so you can see the overhead for yourself. A character outside the alphabet is reported with its position, and so is a group that would give a value too large for 32 bits.
A worked example
The classic example is the four characters “Man ” (with a space), the bytes 4D 61 6E 20. Read as a 32-bit number that is 1,298,230,816. Converted to base 85 it has the five digits 24, 73, 80, 78 and 61, and adding 33 to each gives the characters 9, j, q, o and ^. The encoding of “Man ” is therefore 9jqo^. A longer text from the Sample button gives 55 characters for 44 bytes, exactly one quarter more.
Limits
Ascii85 is an encoding, not a cipher, and it does not compress; the output is larger than the input. The Adobe form is not safe in every text context, because it can contain quotes, backslashes and angle brackets, so check the channel before using it. The page does not wrap output into lines of a fixed width; add line breaks yourself if a format requires them. Variants such as the btoa form of Ascii85 and RFC 1924 are not included.
Related tools
- Base64 Encoder is the more widely supported alternative.
- Base32 Encoder is the case-insensitive, larger alternative.
- Base58 Encoder is meant for short, hand-copied values.
- Quoted-Printable Decoder covers the encoding used in email bodies.
Checked against the current version of the Ascii85 Encoder on .

