Ascii85 Encoder / Decoder

Convert text to and from Ascii85.

Result

87cURD_*#4DfTZ)+T

How it is calculated

Encoding reads the text as bytes and takes them in groups of 4. Each group is read as one 32-bit number n = b0·256³ + b1·256² + b2·256 + b3, which is written in base 85 as five digits; each digit d becomes the character with code d + 33, so the output uses the printable characters from ! to u. A last group of r bytes (fewer than 4) is padded with zero bytes and only the first r + 1 characters are kept. Decoding reverses this: whitespace is removed, characters are read in groups of 5, and a short last group is padded with u. This tool has no <~ ~> wrapper and no z shortcut for four zero bytes; input containing them, or any character outside ! to u, returns no result. Non-ASCII letters take several bytes, so they give more characters.

Worked example

Encode Hello, World!, 13 bytes. The first group Hell is the number 1,214,606,444. In base 85 its digits are 23, 22, 66, 52, 49; adding 33 gives the characters 87cUR. The next groups o, W and orld are converted the same way, and the final single byte ! gives two characters. The full result is 87cURD_*#4DfTZ)+T, 18 characters for 13 bytes. Switching the mode to decode and pasting the result returns Hello, World!.

Try this example →

Common mistakes

  • Pasting Ascii85 with the <~ and ~> markers from a PDF or PostScript file; this tool does not strip them, so remove them first.
  • Expecting the z abbreviation for four zero bytes. It is not produced when encoding and is not accepted when decoding.
  • Leaving the mode on encode when the text is already Ascii85. It is then encoded a second time, giving longer, different text.
  • Copying only part of an encoded string. A missing character changes the group alignment, and the output is garbled or empty.
  • Treating Ascii85 as encryption. It is only a reversible encoding that anyone can decode.

About this calculator

This calculator encodes text to Ascii85 (base85) or decodes it back, using the scheme that packs every 4 bytes of binary data into 5 printable ASCII characters — more space-efficient than Base64's 4-for-3 ratio, at the cost of a wider character set.

Developers working with PDF and PostScript files, where Ascii85 is a native filter, and anyone needing compact text-safe binary encoding, use it to embed binary data in text-only formats.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    As a size check, the 13-byte string Hello, World! becomes 18 characters here, about a quarter longer than the input, whereas Base64 would need 20. The saving is real but modest, and the output uses punctuation that can break in URLs, JSON or shell strings. This tool writes plain groups only, with no delimiter markers or shortcut for zero bytes. Which Ascii85 variant do you work with?

Popular calculators

All Calculators