Base85 (Ascii85) Encoder / Decoder

Encode or decode text in Base85 (classic Ascii85 variant, Adobe/btoa style), used especially in PostScript and PDF files.

Example:

How It Works

Base85 encodes binary data into printable text, like Base64, but with slightly better efficiency (about 25% size increase vs. 33% for Base64) because it uses 85 possible characters per symbol instead of 64. It's the format used internally by PostScript and some PDF streams to embed binary data in text content.

How is it different from Base64?

Base85 groups bytes in blocks of 4 (instead of 3 for Base64) and encodes them into 5 characters (instead of 4), producing a more compact result. In return, Base85 uses a wider alphabet that includes characters like quotes or apostrophes, making it less convenient to paste directly into some contexts (URLs, JSON) than Base64.

Why are some blocks replaced by the letter "z"?

In the classic Ascii85 variant, a group of 4 all-zero bytes (often common in binary data with padding or empty areas) is represented by the single character z instead of the usual 5 characters, saving space.

100% local processing: encoding and decoding run entirely in your browser via WebAssembly.