Toolstia / Ascii85 encoder and decoder

Ascii85 encoder and decoder

Ascii85, also called Base85, writes every 4 bytes as 5 printable characters. It is denser than Base64 and is used in PostScript and PDF files. Paste text or hex to encode, or paste Ascii85 to decode it, with or without the surrounding markers.

Ascii85 turns every 4 bytes into 5 characters, so the output is about 25 percent larger than the input. A run of four zero bytes can be written as a single z.

How it works

  1. Choose encode or decode.
  2. Paste your text, hex bytes or Ascii85 string.
  3. Optionally wrap the output in the angle markers, then copy the result.

How it works

Four bytes are read as one 32 bit number and written as five digits in base 85, using the characters from ! to u. A short final group is padded and then trimmed.

The z shortcut

Four zero bytes would encode to !!!!!, so Ascii85 writes them as a single z. The decoder understands it.

Markers

Adobe style Ascii85 starts with an opening marker and ends with a closing one. You can add them when encoding, and the decoder accepts text with or without them.

Size

The output is about 25 percent larger than the input, compared with about 33 percent for Base64.

Questions

Is this the same as Z85 or Base85 in Git?

No. Those use different 85 character alphabets. This tool follows the Adobe Ascii85 form. Everything happens in your browser, and nothing you enter is sent anywhere.

Can it handle binary data?

Yes. Paste the bytes as hex to encode them, and binary results are shown as hex when decoding.

Why did decoding fail?

Ascii85 only allows characters from ! to u (plus z). A character outside that range, or a lone final character, is an error.