Ascii85 / Base85 Encoder / Decoder
Ascii85 / Base85 FAQ
What is the difference between Base64 and Ascii85?
Base64 converts 3 bytes into 4 characters, while Ascii85 converts 4 bytes into 5 characters. Ascii85 is about 25% more space-efficient.
Why does Ascii85 use <~ and ~>?
These delimiters were introduced by Adobe to mark the beginning and end of Ascii85 streams in PostScript and PDF files.
What does 'z' mean in Ascii85?
In Ascii85, 'z' is a shorthand for 4 consecutive zero bytes. It helps compress sparse binary data.
Is Ascii85 secure?
No. Like Base64, Ascii85 is only encoding, not encryption. Anyone can decode it back to the original data.
Where is Ascii85 used today?
Ascii85 is mainly used in PostScript, PDF file formats, and some archival or embedded systems where compactness matters.
Can I decode Ascii85 back to the original file?
Yes. Ascii85 encoding is fully reversible. As long as the encoded string is intact, decoding will recover the original bytes.
What is Ascii85 / Base85 Encoding?
Ascii85, also known as Base85, is a binary-to-text encoding scheme that was originally designed by Adobe for use in PostScript and PDF file formats. Its primary purpose is to efficiently encode binary data in a form that can be represented as plain text. While Base64 encoding is more commonly known and widely used, Ascii85 has certain advantages, particularly when it comes to reducing encoded data size.
The Ascii85 encoding process converts 4 bytes of binary data into 5 printable ASCII characters. This makes it slightly more efficient than Base64, which converts 3 bytes into 4 characters. As a result, Ascii85 produces encoded output that is about 25% smaller than Base64, making it an appealing choice in contexts where storage efficiency or reduced transmission size matters. For example, Adobe implemented Ascii85 in PDF streams to compactly store binary data like images and fonts.
The syntax of Ascii85 encoding is unique in that it is often wrapped in delimiters <~
at the start and ~>
at the end. It also introduces the special character “z” as shorthand to represent four consecutive zero bytes, improving efficiency further when dealing with sparse binary data. However, these same features mean that Ascii85 decoding must carefully account for these special cases to avoid corruption or misinterpretation of the data.
Although Ascii85 is efficient, it is not as widely supported or standardized as Base64. For example, web APIs and email protocols generally rely on Base64 rather than Ascii85. Nonetheless, Ascii85 remains a relevant choice in environments where its compactness and PostScript/PDF compatibility are essential. In modern cryptographic applications, Base64 tends to dominate, but Ascii85 still has its niche use cases in embedded systems, archival storage, or legacy systems.
It is also important to highlight that Ascii85, like Base64, is not a form of encryption or security. It is purely an encoding scheme, which means its main purpose is to make binary data representable as text. Anyone who has access to the encoded string can easily decode it back to its original form. As such, Ascii85 should never be used as a security measure. When combined with encryption algorithms, however, it can serve as a reliable way to safely transmit or store encrypted binary data in text-based systems.