Base85 / Ascii85 converter

What is a Base85 Converter?

Base85 encodings represent 4 bytes of binary data with 5 printable characters, making them more compact than Base64, which needs 4 characters for every 3 bytes. The overhead is 25% instead of 33%. This tool supports the two most common variants: Ascii85, used by Adobe PostScript and PDF and by the btoa utility, and Z85, the ZeroMQ variant designed to be safe in source code and JSON strings.

How to use it

  1. Choose Ascii85 or Z85.
  2. Paste text to encode, or paste encoded data to decode.
  3. Copy the result.

How Base85 works

Every 4-byte group is read as a 32-bit unsigned integer and written as five base-85 digits. Ascii85 maps the digits to characters 33 (!) to 117 (u), uses z as a shortcut for four zero bytes, and wraps data in <~ and ~> delimiters in Adobe streams. Z85 uses a different alphabet that avoids quotes and backslashes, and requires input lengths that are multiples of 4.

Example

In Ascii85 the text Man (with a trailing space) encodes to 9jqo^. In Z85 the 8 bytes 86 4F D2 6F B5 59 F7 5B encode to HelloWorld, the example from the Z85 specification.

Where you will meet it

  • Inside PDF and PostScript files, in streams with the ASCII85Decode filter.
  • Git binary patches, which use a Base85 variant.
  • ZeroMQ CURVE security keys, which are written in Z85.

Frequently Asked Questions

Is Base85 better than Base64?

It is about 7 percent more compact, but less widely supported and uses characters that may need escaping. Base64 remains the safer default.

What is the difference between Ascii85 and Z85?

They use different alphabets. Z85 avoids quotes and backslashes so it can be pasted into code, and it requires input lengths divisible by 4.

What does the z character mean in Ascii85?

It is a shortcut for a group of four zero bytes, which keeps encoded data with many zeros shorter.

Why does my PDF stream start with a tilde?

Adobe Ascii85 data is delimited by less-than tilde at the start and tilde greater-than at the end.