How to use the Ascii85 tool
- Set Direction to Encode or Decode.
- Paste your text, or the Ascii85 block, into Input. When decoding, line breaks and the
<~ ~>marks are fine. - When encoding, tick Wrap in
<~ ~>(PostScript/PDF) if the output goes into a PostScript or PDF file. - Copy the Encoded or Decoded result.
What it does and when to use it
Ascii85, also called Base85, was developed for the btoa tool and adopted by Adobe for PostScript and PDF. In a PDF, a stream can carry the filter /ASCII85Decode, which means its content is Ascii85 text that must be decoded before use. Decoding such a block here shows what is inside, often further compressed data rather than readable text.
Use the encoder to embed small amounts of data in a text-only format with less overhead than Base64, or to produce test data for a parser. Ascii85 is an encoding, not encryption, and offers no secrecy.
For a version that is safe in source code and JSON strings, use Z85. For URL-safe output, Base64URL is the better choice. To see the bytes of a decoded result, the hex dump viewer shows every byte.
How it works
- Text becomes UTF-8 bytes, read four at a time as a 32-bit number.
- The number is written as five base-85 digits, most significant first. Each digit d becomes the character with code 33 + d, so 0 is
!and 84 isu. - A full group of four zero bytes is written as
z. - A last group of 1 to 3 bytes is padded with zeros, encoded, and cut to bytes + 1 characters.
Decoding removes whitespace and delimiters, expands z, and pads a short final group with u before converting back, then drops the padding bytes. The tool runs in your browser.
Worked examples
Man is distinguished → 9jqo^BlbD-BleB1DJ+*+F(f,q
Hello World (with <~ ~>) → <~87cURD]i,"Ebo7~>
<~87cURD]i,"Ebo80~> (Decode) → Hello World!
sure. → F*2M7/c
“Man is distinguished” and “sure.” are the classic examples used to explain Ascii85. “sure.” is 5 bytes: one full group of 5 characters, then 1 leftover byte that needs 2 characters, 7 in total. Compare the second and third lines: adding “!” to “Hello World” changes only the last group.
Limits and tips
- Text is encoded as UTF-8. Decoded bytes that are not valid UTF-8, common for PDF streams, are shown as hex.
- The
yshortcut for four spaces, used by some btoa versions, is not supported. - A final group of a single character is invalid and is reported as an error.
Frequently asked questions
How much bigger does Ascii85 make my data?
What are the <~ and ~> marks?
What does a z in the output mean?
Is Ascii85 the same as Z85?
Why does decoding fail on a v or w?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.