Skip to content
uencoder

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
    Hello
    Output
    87cURD]

    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

Related tools

References