Ascii85
Ascii85 (Base85) maps every 4 bytes (32 bits) to 5 ASCII characters, an expansion of about 25% — lower than Base64's 33% — and is used in PDF and PostScript.
Purpose
It represents binary data in ASCII-only channels with less overhead than Base64.
Mechanism
Each 4-byte group is treated as a big-endian 32-bit unsigned integer and repeatedly divided by 85; the five remainders (0-84) are each offset by 33 to yield printable ASCII. An all-zero 4-byte group compresses to the single character z. The PDF variant wraps data in < ~ >.
Use cases
- PDF stream object encoding
- PostScript binary embedding
- Base85 representation of IPv6 addresses (an early proposal)
- Compact binary-to-text transfer
Examples
- Input
HelloOutput87cURD]A trailing partial group (fewer than 4 bytes) follows special padding rules
Common errors
- Confusing Ascii85 with Z85 (the ZeroMQ variant uses a different alphabet)
- Confirm which variant's alphabet is in use
Related terms
Base64
Base64 maps arbitrary binary data onto 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) so that binary data can travel over text-only channels. GLOSSARY
Base91
Base91 is a scheme that encodes binary data into 91 printable ASCII characters, with an expansion of about 23% — more compact than Base64. GLOSSARY
UUencode Encoding
UUencode (Unix-to-Unix encoding) is the binary-to-text scheme early Unix systems used to transfer binary files over UUCP; it has since been superseded by Base64/MIME. GLOSSARY