# Ascii85

Ascii85, also called Base85, is a form of binary-to-text encoding developed by Paul E. Rutter for the btoa utility. By using five ASCII characters to represent four bytes of binary data (making the encoded size 1⁄4 larger than the original, assuming eight bits per ASCII character), it is more efficient than uuencode or Base64, which use four characters to represent three bytes of data (1⁄3 increase, assuming eight bits per ASCII character).
Its main modern uses are in Adobe's PostScript and Portable Document Format file formats, as well as in the patch encoding for binary files used by Git.

## Overview

The basic need for a binary-to-text encoding comes from a need to communicate arbitrary binary data over preexisting communications protocols that were designed to carry only English language human-readable text. Those communication protocols may only be 7-bit safe (and within that avoid certain ASCII control codes), and may require line breaks at certain maximum intervals, and may not maintain whitespace. Thus, only the 94 printable ASCII characters are "safe" to use to convey data.
Eighty-five is the minimum integer value of n such that n$^5$ ≥ 256$^4$; so any sequence of 4 bytes can be encoded as 5 symbols, as long as at least 85 distinct symbols are available. (Five radix-85 digits can represent the integers from 0 to 4,437,053,124 inclusive, which suffice to represent all 4,294,967,296 possible 4-byte sequences.)
Characters used by the encoded text are !"#$%&'*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu and additionally z to mark a sequence of four zero bytes.

## Encoding

When encoding, each group of 4 bytes is taken as a 32-bit binary number, most significant byte first (Ascii85 uses a big-endian convention). This is converted, by repeatedly dividing by 85 and taking the remainder, into 5 radix-85 digits. Then each digit (again, most significant first) is encoded as an ASCII printable character by adding 33 to it, giving the ASCII characters 33 (!) through 117 (u).
Because all-zero data is quite common, an exception is made for the sake of data compression, and an all-zero group is encoded as a single character z instead of !!!!!.
Groups of characters that decode to a value greater than 2$^{32}$ − 1 (encoded as s8W-!) will cause a decoding error, as will z characters in the middle of a group. White space between the characters is ignored and may occur anywhere to accommodate line-length limitations.

## Limitations

The original specification only allows a stream that is a multiple of 4 bytes to be encoded.
Encoded data may contain characters that have special meaning in many programming languages and in some text-based protocols, such as left-angle-bracket <, backslash \, and the single and double quotes ' & ". Other base-85 encodings like Z85 and RFC 1924 are designed to be safe in source code.

## History
### btoa version

The original btoa program always encoded full groups (padding the source as necessary), with a prefix line of "xbtoa Begin", and suffix line of "xbtoa End", followed by the original file length (in decimal and hexadecimal) and three 32-bit checksums. The decoder needs to use the file length to see how much of the group was padding. The initial proposal for btoa encoding used an encoding alphabet starting at the ASCII space character through "t" inclusive, but this was replaced with an encoding alphabet of "!" to "u" to avoid "problems with some mailers (stripping off trailing blanks)". This program also introduced the special "z" short form for an all-zero group. Version 4.2 added a "y" exception for a group of all ASCII space characters (0x20202020).

### ZMODEM version

"ZMODEM Pack-7 encoding" encodes groups of 4 octets into groups of 5 printable ASCII characters in a similar, or possibly in the same way as Ascii85 does. When a ZMODEM program sends pre-compressed 8-bit data files over 7-bit data channels, it uses "ZMODEM Pack-7 encoding".

### Adobe version

Adobe adopted the basic btoa encoding, but with slight changes, and gave it the name Ascii85. The characters used are the ASCII characters 33 (!) through 117 (u) inclusive (to represent the base-85 digits 0 through 84), together with the letter z (as a special case to represent a 32-bit 0 value), and white space is ignored. Adobe uses the delimiter "~>" to mark the end of an Ascii85-encoded string, and the string may be prefixed by "<~". Adobe represents the length by truncating the final group: If the last block of source bytes contains fewer than 4 bytes, the block is padded with up to 3 null bytes before encoding. After encoding, as many bytes as were added as padding are removed from the end of the output.
The reverse is applied when decoding: The last block is padded to 5 bytes with the Ascii85 character u, and as many bytes as were added as padding are omitted from the end of the output (see example).
The padding is not arbitrary. Converting from binary to base 64 only regroups bits and does not change them or their order (a high bit in binary does not affect the low bits in the base64 representation). In converting a binary number to base85 (85 is not a power of two) high bits do affect the low order base85 digits and conversely. Padding the binary low (with zero bits) while encoding and padding the base85 value high (with us) in decoding assures that the high order bits are preserved (the zero padding in the binary gives enough room so that a small addition is trapped and there is no "carry" to the high bits).
In Ascii85-encoded blocks, whitespace and line-break characters may be present anywhere, including in the middle of a 5-character block, but they must be silently ignored.
Adobe's specification does not support btoa's y exception.

### Example for Ascii85

Take this quote from Thomas Hobbes's Leviathan:
Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.
Assuming that 269-character quote is provided in US-ASCII or a 100% compatible encoding to start with, it can then be re-encoded in Ascii85 as the following 337 characters (count and output shown without "<~" and "~>" pre/postfixes):
For a detailed look at the re-encoding, this is the beginning of the Hobbes quote:
| Text content | M | M | M | M | M | M | M | M | a | a | a | a | a | a | a | a | n | n | n | n | n | n | n | n | | | | | | | | | ... |
| ASCII | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 77 (0x4d) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 97 (0x61) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 110 (0x6e) | 32 (0x20) | 32 (0x20) | 32 (0x20) | 32 (0x20) | 32 (0x20) | 32 (0x20) | 32 (0x20) | 32 (0x20) | ... |
| Bit pattern | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | ... |
| 32-bit value | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | 1,298,230,816 = 24×85$^4$ + 73×85$^3$ + 80×85$^2$ + 78×85 + 61 | ... |
| Base 85 (+33) | 24 (57) | 24 (57) | 24 (57) | 24 (57) | 24 (57) | 24 (57) | 73 (106) | 73 (106) | 73 (106) | 73 (106) | 73 (106) | 73 (106) | 73 (106) | 80 (113) | 80 (113) | 80 (113) | 80 (113) | 80 (113) | 80 (113) | 78 (111) | 78 (111) | 78 (111) | 78 (111) | 78 (111) | 78 (111) | 78 (111) | 61 (94) | 61 (94) | 61 (94) | 61 (94) | 61 (94) | 61 (94) | ... |
| ASCII | 9 | 9 | 9 | 9 | 9 | 9 | j | j | j | j | j | j | j | q | q | q | q | q | q | o | o | o | o | o | o | o | ^ | ^ | ^ | ^ | ^ | ^ | ... |
...and the following is the end of the quote (penultimate 4-tuple):
| Text content | s | s | s | s | s | s | s | s | u | u | u | u | u | u | u | u | r | r | r | r | r | r | r | r | e | e | e | e | e | e | e | e |
| ASCII | 115 (0x73) | 115 (0x73) | 115 (0x73) | 115 (0x73) | 115 (0x73) | 115 (0x73) | 115 (0x73) | 115 (0x73) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 117 (0x75) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 114 (0x72) | 101 (0x65) | 101 (0x65) | 101 (0x65) | 101 (0x65) | 101 (0x65) | 101 (0x65) | 101 (0x65) | 101 (0x65) |
| Bit pattern | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 32-bit value | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 | 1,937,076,837 = 37×85$^4$ + 9×85$^3$ + 17×85$^2$ + 44×85 + 22 |
| Base 85 (+33) | 37 (70) | 37 (70) | 37 (70) | 37 (70) | 37 (70) | 37 (70) | 9 (42) | 9 (42) | 9 (42) | 9 (42) | 9 (42) | 9 (42) | 9 (42) | 17 (50) | 17 (50) | 17 (50) | 17 (50) | 17 (50) | 17 (50) | 44 (77) | 44 (77) | 44 (77) | 44 (77) | 44 (77) | 44 (77) | 44 (77) | 22 (55) | 22 (55) | 22 (55) | 22 (55) | 22 (55) | 22 (55) |
| ASCII | F | F | F | F | F | F | * | * | * | * | * | * | * | 2 | 2 | 2 | 2 | 2 | 2 | M | M | M | M | M | M | M | 7 | 7 | 7 | 7 | 7 | 7 |
As however the final 4-tuple is incomplete after the period, it must be padded with three zero bytes:
| Text content | . | . | . | . | . | . | . | . | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 | \0 |
| ASCII | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 46 (0x2e) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) | 0 (0x00) |
| Bit pattern | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 32-bit value | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 | 771,751,936 = 14×85$^4$ + 66×85$^3$ + 56×85$^2$ + 74×85 + 46 |
| Base 85 (+33) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 56 (89) | 56 (89) | 56 (89) | 56 (89) | 56 (89) | 56 (89) | 74 (107) | 74 (107) | 74 (107) | 74 (107) | 74 (107) | 74 (107) | 74 (107) | 46 (79) | 46 (79) | 46 (79) | 46 (79) | 46 (79) | 46 (79) |
| ASCII | / | / | / | / | / | / | c | c | c | c | c | c | c | Y | Y | Y | Y | Y | Y | k | k | k | k | k | k | k | O | O | O | O | O | O |
Since three bytes of padding had to be added, the three final characters 'YkO' are omitted from the output.
Decoding is done inversely, except that the last 5-tuple is padded with 'u' characters:
| ASCII | / | / | / | / | / | / | c | c | c | c | c | c | c | u | u | u | u | u | u | u | u | u | u | u | u | u | u | u | u | u | u | u |
| Base 85 (+33) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 14 (47) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 66 (99) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) | 84 (117) |
| 32-bit value | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 | 771,955,124 = 14×85$^4$ + 66×85$^3$ + 84×85$^2$ + 84×85 + 84 |
| Bit pattern | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| ASCII | 46 | 46 | 46 | 46 | 46 | 46 | 46 | 46 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 25 | 180 | 180 | 180 | 180 | 180 | 180 | 180 | 180 |
| Text content | . | . | . | . | . | . | . | . | [ ETX ] | [ ETX ] | [ ETX ] | [ ETX ] | [ ETX ] | [ ETX ] | [ ETX ] | [ ETX ] | [ EM ] | [ EM ] | [ EM ] | [ EM ] | [ EM ] | [ EM ] | [ EM ] | [ EM ] | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) | ´ (Extended ASCII) |
Since the input had to be padded with three 'u' bytes, the last three bytes of the output are ignored and we end up with the original period.
The input sentence does not contain 4 consecutive zero bytes, so the example does not show the use of the 'z' abbreviation.

### Compatibility

The Ascii85 encoding is compatible with 7-bit and 8-bit MIME, while having less overhead than Base64.
One potential compatibility issue of Ascii85 is that some of the characters it uses are significant in markup languages such as XML or SGML. To include Ascii85 data in these documents, it may be necessary to escape the quote, angle brackets, and ampersands.

## RFC 1924 version

Published on April 1, 1996, informational RFC 1924: "A Compact Representation of IPv6 Addresses" by Robert Elz suggests a base-85 encoding of IPv6 addresses as an April Fools' Day joke. This differs from the scheme used above in that he proposes a different set of 85 ASCII characters, and proposes to do all arithmetic on the 128-bit number, converting it to a single 20-digit base-85 number (internal whitespace not allowed), rather than breaking it into four 32-bit groups.
The proposed character set is, in order, 0–9, A–Z, a–z, and then the 23 characters !#$%&*+-;<=>?@^_`{|}~. The highest possible representable address, 2$^{128}$−1 = 74×85$^{19}$ + 53×85$^{18}$ + 5×85$^{17}$ + ..., would be encoded as =r54lj&NUUO~Hi%c2ym0.
This character set excludes the characters "',./:[\] , making it suitable for use in JSON strings (where " and \ would require escaping). However, for SGML-based protocols, notably including XML, string escapes may still be required (to accommodate <, > and &).