ASCII85 (also called Adobe Base85) is a binary-to-text encoding used inside PostScript and PDF files to embed binary data such as images and fonts as printable ASCII. This tool encodes text into ASCII85 and decodes ASCII85 back to text, which is useful for developers inspecting or building PDF/PostScript streams.
How it works
ASCII85 takes four input bytes at a time, treats them as a single 32-bit number, and converts that number to base 85, producing five characters in the range ! (33) to u (117). This 4-to-5 expansion is more compact than Base64’s 3-to-4. Adobe’s variant adds two conventions:
- The full stream is wrapped in
<~at the start and~>at the end. - A group of four zero bytes is written as a single
zinstead of!!!!!.
A final partial group of n bytes encodes to n+1 characters. When decoding, the tool tolerates missing delimiters and ignores whitespace between characters.
Why ASCII85 over Base64?
Both encodings solve the same problem: carrying arbitrary binary data through a channel that only supports printable ASCII characters. ASCII85 is more efficient:
| Encoding | Input bytes per group | Output chars per group | Overhead |
|---|---|---|---|
| Base64 | 3 bytes | 4 characters | 33% |
| ASCII85 | 4 bytes | 5 characters | 25% |
The 8% efficiency advantage may seem modest, but in a large PDF with embedded images it can reduce file size by tens of kilobytes. This is why Adobe chose ASCII85 for PostScript and PDF rather than Base64 when those formats were designed.
The character range ! to u (85 printable ASCII characters) was chosen to avoid characters that
have special meaning in PostScript ((, ), %, {, }) while staying in the printable range
that plain-text channels handle safely.
When to use this tool
PDF inspection: PDF is a text format that embeds binary streams such as images, compressed
content, and fonts. If the stream filter is /ASCII85Decode, the stream body will be ASCII85
encoded. Paste it here to decode and inspect the raw bytes.
PostScript debugging: PostScript programs commonly use ASCII85 to include bitmap images. Decoding the stream can reveal whether the embedded data is correct.
Building PDF writers: If you are writing a library that generates PDFs without an external dependency, you may need to implement ASCII85 encoding for images. This tool is useful for validating your implementation against a known-good encoder.
Example
Encoding the text “Man ” (four bytes: 77, 97, 110, 32) produces the base-85 group 9jqo^, wrapped as:
<~9jqo^~>
The four bytes form a 32-bit number: (77 × 256³) + (97 × 256²) + (110 × 256) + 32 = 1,298,230,816.
Divide that into base-85 digits from most significant to least: 9, j, q, o, ^ (each plus 33 to
map to a printable character). All five characters lie in the !–u range.
A full string of zero bytes would normally encode as !!!!! per group, but the z shorthand
replaces each group of four zero bytes with a single character — a compression that matters when
binary data contains long runs of zeroes, as image padding often does.
ASCII85 encoding and decoding run entirely in your browser; your data stays on your device.