Format Code Now
/
Encode & decodeAscii85 Encoder and Decoder Next: CSV Escape and Unescape ›

Ascii85 Encoder and Decoder

ED-24

Paste text or hex bytes to get Ascii85, or paste Ascii85 to get the bytes back. It handles the Adobe form, including the <~ and ~> markers and z for four zero bytes.

Runs in your browser. Nothing is uploaded.

Text, hex bytes or Ascii85

Result

How to use it

  1. Paste text, hex bytes or Ascii85 into the input box.
  2. Choose whether encoding input is text or hex, and whether decoded output is shown as text or hex.
  3. Tick Add markers if you want <~ and ~> around the result, and pick a line width if you want wrapping.
  4. Click Encode or Decode, then copy the result or download it.

How Ascii85 works

Four bytes are read as one 32 bit number and written as five characters from ! to u, which gives 5 characters for every 4 bytes. That is shorter than Base64, which needs 4 characters for every 3 bytes. A group of four zero bytes is written as the single letter z. A final group of 1 to 3 bytes gives 2 to 4 characters, and decoding fills the rest.

Markers, whitespace and errors

When decoding, an optional <~ at the start and ~> at the end are accepted and whitespace is ignored. The tool reports characters outside the range, a z in the middle of a group, a single leftover character at the end, and a group too large to fit in four bytes, each with its position where it has one. Text after ~> other than whitespace is an error.

Variants not included

This is the Adobe form used in PostScript and PDF. Z85, which uses a different alphabet, the RFC 1924 alphabet, the older btoa form with y for four spaces, and the Base85 variants in Git and Python are not offered. They look similar but give different text for the same bytes, so check which one your data uses.

Error messages and what to do

MessageWhat it meansFix
Invalid Ascii85 characterA character is outside the range ! to u (and not z).Check the position shown; a stray ~ or a letter above u is the usual cause.
is inside a groupThe letter z appeared in the middle of a 5 character group.z is only valid between groups. The text may be damaged or use another variant.
is too large to be 4 bytesA 5 character group adds up to more than 4 bytes can hold.The data is likely corrupted or is not Ascii85.
single leftover characterThe data ends with one character, which cannot encode a byte.The text is probably cut off; copy the whole string.

Questions people ask

How do I encode text to Ascii85?

Paste the text and click Encode. It is converted to UTF-8 bytes first. For example the four characters Man followed by a space become 9jqo^. Tick Add markers to wrap the result in <~ and ~>.

What does the z in Ascii85 mean?

It stands for four zero bytes in a row, written as one character instead of five (!!!!!). It only appears between groups, and the tool uses it when encoding. Decoding turns it back into four zero bytes.

Are the <~ and ~> markers required?

No. The tool decodes with or without them. When encoding they are off by default and you can turn them on. PostScript and PDF streams use them to mark the start and end of the data.

Is Ascii85 the same as Base85?

Not exactly. Base85 is a family name. This tool does the Adobe Ascii85 form. The RFC 1924 alphabet, Z85 and the variants used by Git and Python use other characters, so their text will not decode here.

How much bigger is Ascii85 than the original data?

About a quarter bigger, because 4 bytes become 5 characters. Base64 adds about a third. Runs of four zero bytes shrink to one character with z, so data with many zero bytes can come out smaller than that.

Is my data uploaded?

No. Everything runs in your browser, so the text or bytes you paste are not sent anywhere. The tool needs no sign-up, and it makes no network requests while it encodes or decodes your input.

About this tool

Ascii85 as used in PostScript and PDF: every 4 bytes become 5 characters from ! to u, and a group of four zero bytes is written as the single letter z. A last group of 1 to 3 bytes gives 2 to 4 characters. Decoding accepts an optional <~ at the start and ~> at the end, ignores whitespace, and reports an invalid character, a z inside a group, a lone final character or an overflowing group with its position. Related variants are not included: Z85, the RFC 1924 alphabet, the btoa form with y for spaces, and Base85 in Git or Python.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.