TFT

Base85 (Ascii85) Encoder and Decoder

Encode data to Base85 (Ascii85) format for efficient binary-to-text encoding, or decode Base85 strings to retrieve the original data. Used in PDF files and other binary data representations.

Base85 (Ascii85) Encoder/Decoder

Encode data to Base85/Ascii85 format and decode Base85 strings. Used in PDF files and PostScript.

About Base85/Ascii85

Base85 (Ascii85) is a binary-to-text encoding that uses 85 ASCII characters. It's more efficient than Base64, producing 25% smaller output. Adobe Ascii85 (used in PDF and PostScript) wraps output with <~ and ~> delimiters. RFC 1924 is an alternative variant with a different character set.

How the Base85/Ascii85 Encoder/Decoder Works

Our Base85/Ascii85 encoder/decoder converts binary data to and from Base85 format, a highly efficient binary-to-text encoding scheme. Base85 produces shorter output than Base64 (25% smaller) by encoding 4 bytes into 5 characters using 85 printable ASCII characters.

Encoding Process

  1. Input data is divided into 4-byte groups
  2. Each group is treated as a 32-bit integer
  3. Integer is converted to base-85 representation
  4. Each digit maps to a printable ASCII character (! to u)
  5. Special case: all-zero groups encode as single 'z'
  6. Final output is compact ASCII string

Common Use Cases

PostScript and PDF

Ascii85 encoding is used in PostScript and PDF files for embedding binary data efficiently.

Git Internal Storage

Git uses Base85 (Z85 variant) for encoding binary data in packfiles and object storage.

ZeroMQ Messaging

Z85 encoding is used in ZeroMQ for encoding binary keys and messages in text protocols.

Data Compression

Use Base85 when text encoding is required but output size matters more than with Base64.

What to Know Before Using This Tool

Base85 Variants

Multiple Base85 variants exist: Ascii85 (PostScript/PDF), Z85 (ZeroMQ), and RFC 1924. This tool supports standard Ascii85 encoding. Variants differ in character set and special handling.

Efficiency Comparison

Base85 produces 5 characters per 4 bytes (125% overhead). Base64 produces 4 characters per 3 bytes (133% overhead). Base85 is approximately 25% more efficient than Base64.

Frequently Asked Questions

What is the difference between Base85 and Ascii85?

Ascii85 is the original Base85 variant used in PostScript and PDF. Other Base85 variants (Z85, RFC 1924) use different character sets optimized for specific use cases.

Why use Base85 over Base64?

Base85 produces shorter output, reducing bandwidth and storage. Use when encoding efficiency matters and the slightly more complex character set is acceptable.