Ascii85 / Base85 Encoder & Decoder
Ascii85 packs binary data into printable characters more efficiently than Base64 — about a 25% expansion instead of 33%. Paste text to encode it, or paste Ascii85 to decode it, choosing the classic Adobe style or the plain variant. Everything runs locally and updates as you type.
How to use the Ascii85 / Base85 Encoder & Decoder
Choose Encode to turn text into Ascii85, or Decode to turn Ascii85 back into text, then type or paste into the input box. The result appears below and updates live; Copy output places it on your clipboard. UTF-8 is used throughout, so accented characters and emoji round-trip correctly.
The Variant selector controls the framing. Adobe wraps the data in the <~ and ~> delimiters used by PostScript and PDF and applies the z shortcut for an all-zero group; Plain emits just the encoded characters with no delimiters, which is what many libraries and the btoa-style use cases expect. When decoding, the tool accepts input with or without the Adobe delimiters and ignores whitespace, so you can paste a wrapped block straight from a PDF stream.
It all runs in your browser with no network calls, so binary blobs and sensitive payloads stay on your machine and it works offline.
What Ascii85 is and why it exists
Ascii85, also called Base85, is a binary-to-text encoding that represents arbitrary bytes using printable ASCII characters. Its reason for existing is efficiency: Base64 maps every 3 bytes to 4 characters, a 33% size increase, because it only uses 64 symbols and so encodes 6 bits per character. Ascii85 uses 85 symbols, which is the smallest count whose fourth power (85⁴ = 52,200,625) exceeds the number of values in four bytes (2³² ≈ 4.29 billion). That lets it pack 4 bytes into 5 characters — a 25% increase — making the output noticeably shorter than Base64 for the same data.
The algorithm works on groups of four bytes. Each group is read as a single 32-bit big-endian number, then repeatedly divided by 85 to produce five digits in base 85; each digit is offset by the character ! (ASCII 33) to land in the printable range from ! to u. A common shortcut, used in the Adobe variant, replaces a group of four zero bytes with the single letter z instead of !!!!!, since runs of zeros are frequent in binary data. The final partial group is padded to four bytes, encoded, and then truncated by the number of padding bytes, which is how the decoder knows the original length without storing it separately.
The best-known use is inside PostScript and PDF, where Adobe adopted Ascii85 to embed images and other binary streams in otherwise text-based files; there the data is bracketed by <~ and ~>. A closely related flavor, Z85, tweaks the character set to avoid quotes and backslashes so the output is safe to embed in source code and is used by the ZeroMQ networking library. The trade-offs are that Ascii85 uses characters like quotes and angle brackets that are awkward in some contexts (which is why it never displaced Base64 on the web), and that it is slightly more complex to implement. But where compactness matters and the surrounding format is tolerant — document streams, certain binary protocols — its smaller footprint is a real advantage.
Common use cases
- PDF and PostScript. Encode or decode the Ascii85 streams used to embed binary data in documents.
- Compact transport. Carry binary data through text channels with less bloat than Base64.
- Debugging. Decode an Ascii85 block you found in a file or protocol to inspect its contents.
- Learning. Compare the size and form of Ascii85 against Base64 for the same input.