Base85 Encoder and Decoder
Base85 squeezes four bytes into five ASCII characters — denser than Base64’s 3-for-4 ratio — by using an 85-character alphabet instead of 64. Adobe’s Ascii85 variant ships inside every PostScript and PDF file; the newer Z85 (ZeroMQ) variant avoids characters that break inside C strings and XML. This tool encodes and decodes both, with optional delimiters.
How to convert Base85
-
1
Pick the variant
Ascii85 for PDF/PostScript assets; Z85 for source code and network protocols.
-
2
Paste text or upload a file
Encode direction takes raw bytes; decode direction takes a Base85 string.
-
3
The encoder chunks by 4 bytes
Every 4-byte block becomes a 5-character Base85 string. The final block is padded and truncated.
-
4
Copy the result
Ascii85 optionally wrapped with `<~` and `~>` delimiters; Z85 without delimiters.
Size overhead comparison
| Encoding | Chars per 4 bytes | Overhead vs binary |
|---|---|---|
| Hex | 8 | +100% |
| Base64 | 5.33 (rounded up to 8 with padding) | +37% |
| Base85 | 5 | +25% |
| Raw binary | 4 | 0 |
So 1 MB of binary becomes 1.25 MB in Base85, 1.33 MB in Base64, 2 MB in hex.
Ascii85 vs Z85 alphabets
Ascii85 (RFC 1924 / Adobe): characters ! through u (33-117 in ASCII), plus z as a shortcut for 4 zero bytes. Used in PostScript and PDF streams, wrapped as <~...~>.
Z85 (ZeroMQ): a subset that avoids quote characters and escapes:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#
Safe to embed in JSON, XML, C strings and source code without escaping.
How the math works
Every 4 bytes are read as a big-endian 32-bit integer N. The 5 output characters are the digits of N in base 85, most significant first. 85^5 = 4 437 053 125 which is greater than 2^32, so 4 bytes always fit in 5 characters.
When Ascii85 matters
Open any PDF in a text editor and search for ASCII85Decode — Adobe uses it as a filter for embedded images and fonts that need to survive a 7-bit transport (old fax-style systems). Z85 is widely used in ZeroMQ CURVE authentication keys.
Special cases
- All-zero 4-byte block — Ascii85 encodes it as the single character
zinstead of!!!!!. - All-space 4-byte block — Some variants use
yfor four spaces, others do not. - Last partial block — Padded with zero bytes, and the corresponding number of output characters is truncated at the end.
Frequently Asked Questions
Smaller output, yes. Universally compatible, no. Base85 contains characters like <, >, &, " (in Ascii85) that need escaping in XML, JSON and URLs. Z85 avoids this but most tooling speaks Base64 natively.
Ascii85 if you are working with PostScript or PDF files. Z85 for source code, config files and network protocols. RFC 1924 IPv6 encoding is a different assignment of the same 85 characters and is rarely used in practice.
No. They use different alphabets. Decoding Ascii85 with a Z85 table will produce garbage. Pick one before encoding and stick to it.
For Adobe Ascii85 in PDF or PostScript streams, yes — they mark the encoded region. For standalone use and all Z85 output, no delimiters are needed.
Related Tools
AES Encrypt / Decrypt
Encrypt and decrypt low-risk text with AES OpenSSL ciphers. The passphrase is hashed with SHA-256 and the Base64 output is IV plus ciphertext.
A1Z26 Cipher Encoder
Encode text using the A1Z26 cipher (A=1, B=2, ... Z=26) or decode a number sequence back to letters, with customizable separator.
bcrypt Hash Generator
Generate bcrypt hashes or verify a plaintext password against an existing bcrypt hash. Side-by-side generate and verify in one tool.
Base32 Encoder and Decoder
Encode and decode Base32 strings using the RFC 4648 alphabet. Useful for TOTP secrets, case-insensitive tokens and human-typed identifiers.
Atbash Cipher Encoder
Encode or decode text with the Atbash cipher, a Hebrew substitution that maps A-Z to Z-A. Same operation encrypts and decrypts.
bcrypt Generator
Generate a bcrypt hash from a plaintext password. Adjustable cost factor from 4 to 14, compatible with Laravel, Django, Node and PHP.