Logo

MonoCalc

/

Base85 Encoder

Encode/Decode

Input (Plain Text)

About This Tool

🔢 Base85 Encoder – ASCII85, Z85 & RFC 1924 Online Tool

Base85 encoding (also known as ASCII85) is a binary-to-text encoding scheme that represents binary data using 85 printable ASCII characters. Unlike Base64 which maps every 3 bytes to 4 characters (33% overhead), Base85 maps every 4 bytes to 5 characters — achieving roughly 25% overhead and making its output approximately 20% smaller than equivalent Base64 output.

How Base85 Encoding Works

The encoding process works by treating each group of 4 input bytes as a 32-bit unsigned integer. That integer is then expressed as a 5-digit number in base 85, with each digit mapped to a printable ASCII character from the chosen character set.

For example, in the ASCII85 (Adobe/PostScript) variant, the encoding uses characters from ! (ASCII 33) through u (ASCII 117). The output is wrapped in <~ and ~> delimiters as defined by the Adobe standard. A special optimization applies: any 4-byte block that is all zeros is encoded as the single character z instead of !!!!!, saving 4 characters per null block.

The Three Supported Variants

ASCII85 (Adobe)

The classic variant from Adobe PostScript and PDF. Uses characters ! to u (ASCII 33–117). Wraps output in <~ ~> delimiters. Supports partial final blocks and zero-block compression with z.

Z85 (ZeroMQ)

Used by the ZeroMQ messaging library. Employs an alphanumeric-first character set: 0–9, a–z, A–Z, and a set of symbols. URL-friendly. Requires input byte count to be a multiple of 4.

RFC 1924

Defined in RFC 1924 for compact IPv6 address representation. Uses digits, uppercase letters, lowercase letters, and a set of additional symbols. Often used for representing large integers or IPv6 addresses in compact form.

Base85 vs Base64 vs Base16

To understand why Base85 is preferred in certain scenarios, consider encoding 100 bytes of binary data:

  • Base16 (Hex): 200 characters — 100% overhead
  • Base64: ~136 characters — ~33% overhead
  • Base85: ~125 characters — ~25% overhead

The size difference becomes significant at scale. For a 1 MB binary file, Base85 saves roughly 85 KB compared to Base64 — meaningful in PDF file streams, Git binary patches, or network protocol payloads where every byte counts.

Real-World Applications

PDF and PostScript Streams

Adobe Systems defined ASCII85 as the standard encoding for binary data streams in PDF and PostScript files. Image data, fonts, and compressed streams are routinely encoded this way to keep the file in a text-safe format.

Git Binary Patches

Git uses a variant of Base85 when generating binary patches (git format-patch with binary files). This ensures binary diffs can be shared as plain-text email or stored in text-based systems without corruption.

ZeroMQ (Z85)

The ZeroMQ messaging library uses the Z85 variant for encoding binary keys and security tokens in a URL-safe, shell-safe format. Z85's character set is designed to be safe across all common systems and protocols.

Input Modes: Plain Text and Hex

This tool supports two input modes:

  • Plain Text: Enter any UTF-8 text and it will be encoded by converting each character to its byte representation first.
  • Hex String: Provide raw byte values as a hexadecimal string (e.g., 48656C6C6F) to encode exact byte sequences. Spaces and colons are automatically stripped.

Line Wrapping

Long Base85 strings can be hard to embed in source code, email bodies, or document comments. The line wrap option splits the output at a configurable column width (commonly 76 or 80 characters), making it easy to paste into any context without breaking formatting.

Tips for Using This Tool

  • Use ASCII85 for general-purpose encoding — it's the most widely supported variant and handles any input length.
  • Use Z85 when working with ZeroMQ or when you need a URL-safe character set — but ensure your input is a multiple of 4 bytes.
  • Use RFC 1924 for compact IPv6 address representation or when interoperating with systems that expect that character set.
  • Enable Auto Encode to see the result update in real time as you type.
  • Download the encoded output as a .txt file for easy integration into other workflows.

Frequently Asked Questions

Is the Base85 Encoder free?

Yes, Base85 Encoder is totally free :)

Can I use the Base85 Encoder offline?

Yes, you can install the webapp as PWA.

Is it safe to use Base85 Encoder?

Yes, any data related to Base85 Encoder only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is Base85 encoding and how does it work?

Base85 (ASCII85) encodes binary data by grouping 4 bytes (32 bits) into 5 printable ASCII characters using a base-85 numeral system. Each 4-byte block is interpreted as a 32-bit integer and converted to five base-85 digits, achieving roughly 25% overhead — better than Base64's 33% overhead.

What are the differences between ASCII85, Z85, and RFC 1924?

ASCII85 (Adobe/PostScript) uses characters from '!' to 'u' and wraps output in '<~' and '~>' delimiters. Z85 (ZeroMQ) uses a URL-friendly character set but requires input to be a multiple of 4 bytes. RFC 1924 uses a compact set designed for representing large integers and IPv6 addresses.

Why is Base85 more efficient than Base64?

Base64 encodes every 3 bytes into 4 characters (33% overhead). Base85 encodes every 4 bytes into 5 characters (~25% overhead). This makes Base85-encoded output roughly 20% smaller than equivalent Base64 output, which matters in bandwidth-sensitive or storage-constrained applications.

Where is Base85 encoding commonly used?

Base85 is used in Adobe PDF and PostScript file streams, Git binary patches, ZeroMQ messaging protocol (Z85 variant), and IPv6 address compaction (RFC 1924). It allows binary data to be safely embedded in text-based formats while being more efficient than Base64.

What is the Z85 variant and when should I use it?

Z85 is the Base85 variant used by the ZeroMQ messaging library. It uses a character set that avoids problematic characters in shell scripts and URLs. Use Z85 when working with ZeroMQ protocols. Note: Z85 requires the input byte count to be a multiple of 4.

Is Base85 encoding the same as encryption?

No. Base85 is a binary-to-text encoding scheme, not encryption. It transforms data into a printable ASCII representation but provides no security or confidentiality. Anyone can decode Base85 data back to its original form. For sensitive data, combine encoding with proper encryption such as AES.