Base85 Encoder and Decoder

Base85 squeezes four bytes into five ASCII characters, denser than Base64’s 3-for-4 ratio, by using an 85-character alphabet instead of 64. This tool implements Adobe’s Ascii85 variant, the one shipped inside PostScript and PDF files. The encoder always wraps its output in <~ and ~> delimiters, and the decoder accepts input with or without them.

How to convert Base85 (Ascii85)

  1. 1

    Choose encode or decode

    Encode turns raw bytes into Ascii85; decode turns an Ascii85 string back into bytes.

  2. 2

    Paste your text

    Paste the bytes to encode or the Ascii85 string to decode into the input box.

  3. 3

    The encoder chunks by 4 bytes

    Every 4-byte block becomes a 5-character Base85 string. The final block is padded and truncated.

  4. 4

    Copy the result

    Ascii85 output is wrapped in `<~` and `~>` delimiters. Paste it back to decode it; the delimiters are stripped automatically.

Size overhead comparison

Encoding Chars per 4 bytes Overhead vs binary
Hex 8 +100%
Base64 5.33 (rounded up to 8 with padding) +37%
Base85 5 +25%
Raw binary 4 0

So 1 MB of binary becomes 1.25 MB in Base85, 1.33 MB in Base64, 2 MB in hex.

The Ascii85 alphabet

Ascii85 (Adobe): characters ! through u (33-117 in ASCII), plus z as a shortcut for 4 zero bytes. It is the standard encoding used in PostScript and PDF streams, wrapped as <~...~>.

Z85 (ZeroMQ) and the RFC 1924 IPv6 alphabet are different assignments of the same 85-character idea. This tool does not implement them, so strings encoded in those flavors would decode incorrectly here.

How the math works

Every 4 bytes are read as a big-endian 32-bit integer N. The 5 output characters are the digits of N in base 85, most significant first. 85^5 = 4 437 053 125 which is greater than 2^32, so 4 bytes always fit in 5 characters.

When Ascii85 matters

Open any PDF in a text editor and search for ASCII85Decode. Adobe uses it as a filter for embedded images and fonts that need to survive a 7-bit transport (old fax-style systems). The same encoding appears in many PostScript files and email-safe binary transports.

Special cases

  • All-zero 4-byte block: Ascii85 encodes it as the single character z instead of !!!!!.
  • Last partial block: Padded with zero bytes, and the corresponding number of output characters is truncated at the end.

Frequently Asked Questions

Smaller output, yes. Universally compatible, no. Ascii85 contains characters like <, >, &, " that need escaping in XML, JSON and URLs. Most tooling speaks Base64 natively.

Inside PostScript and PDF streams, where the encoded region is marked with <~ and ~>. PDF viewers and editors handle this encoding automatically.

No. It implements Adobe Ascii85 only. Z85 (ZeroMQ) and the RFC 1924 IPv6 alphabet use different 85-character assignments, so a string encoded in those flavors would decode incorrectly here.

They mark the encoded region in the Ascii85 convention. The encoder always adds them, and the decoder strips them automatically when present. You can also paste a string without them.

Related Tools

Tool available in other languages