Base85 (also known as Ascii85) is a binary-to-text encoding scheme that is more compact than Base64. Here's a detailed guide on how to use this tool:
In text mode, paste the text you want to encode into the input box, select the format (Adobe Ascii85 or Z85), and click the "Encode" button to get the Base85 encoded result. The tool automatically converts text to UTF-8 byte stream before encoding. The encoded result can be copied or downloaded as a text file.
Paste the Base85 encoded text into the input box, make sure to select the correct format (Adobe Ascii85 or Z85), and click the "Decode" button to restore the original content. If it's a file encoding result, the decoded binary file will be offered for download automatically.
Switch to file mode, click to select a file or drag and drop it into the upload area. Supports any file type (images, PDFs, executables, etc.). Select the format and click "Encode" β the encoded result will appear in the result area. You can copy the result or download it as a .txt file.
Adobe Ascii85 uses characters from '!' to 'u' and wraps data with <~ and ~> delimiters, supporting 'z' shorthand for four zero bytes. Z85 is the ZeroMQ variant with a slightly different character set that excludes special characters like quotes, making it more suitable for embedding in JSON and other string environments.
Base85 encoding has wide applications across multiple technical domains. Here are several typical use cases:
PDF Internal Data Encoding: Adobe PDF documents internally use Ascii85 encoding to compress and store binary stream data such as images and embedded fonts. When developing PDF parsing tools, Base85 is needed to decode these internal data streams. This tool helps developers quickly decode and debug Ascii85 encoded content in PDFs.
Git Binary Patches: Git version control uses Base85 encoding to store delta-compressed data when handling binary file differences. When manually reviewing or modifying Git patch files, this tool can be used to decode and analyze the Base85 encoded sections.
PostScript Document Encoding: PostScript extensively uses Ascii85 encoding to embed binary resources. When parsing or generating PostScript documents, Base85 encoding is an essential operation. This tool helps PostScript developers quickly test encoding and decoding.
ZeroMQ Message Transmission: ZeroMQ uses the Z85 format at the protocol level to encode binary data. When developing applications integrated with ZeroMQ, this tool can be used to generate and verify Z85 encoded data.
Base85 Encoding Principle: Base85 encodes every 4 bytes (32 bits) of data into 5 ASCII characters. During encoding, 4 bytes are combined into a 32-bit unsigned integer, then repeatedly divided by 85 with remainders mapped to 85 characters. During decoding, the reverse process is applied. Since 85^5 = 4,437,970,625 > 2^32 = 4,294,967,296, 5 characters are sufficient to represent all possible values of 4 bytes.
Adobe Ascii85 Special Handling: The Adobe format uses characters from '!' to 'u' (ASCII 33-117). When all 4 bytes are zero, a single 'z' character replaces '!!!!!' to further compress zero data. Encoded results are wrapped with '<~' and '~>' to identify boundaries in text. Each line is typically limited to 80 characters.
Z85 Format Characteristics: Z85 is the variant designed by ZeroMQ, with a character set that excludes characters that might be misinterpreted by JSON, XML, and other formats (such as quotes and angle brackets). It doesn't use delimiters or the 'z' shorthand. Z85 is particularly suitable for scenarios requiring embedding in configuration files, JSON fields, or URL parameters.
Comparison with Base64: Base85 is more compact than Base64 (25% vs 33% expansion), but encoding and decoding require slightly more computation. Base64 uses a wider character set (A-Z, a-z, 0-9, +, /), while Base85 uses a continuous ASCII range. In scenarios requiring minimal text size, Base85 is the better choice.
Base85 uses 85 printable ASCII characters, encoding every 4 bytes into 5 characters with a data expansion rate of about 25%. Base64 uses 64 characters, encoding every 3 bytes into 4 characters with an expansion rate of about 33%. Therefore Base85 is more compact than Base64 and is commonly used in space-sensitive scenarios such as PDF internal encoding and Git binary patches.
Adobe Ascii85 uses a specific 85-character set (from '!' to 'u') and wraps data with <~ and ~> delimiters, supporting 'z' shorthand for four zero bytes. Z85 is the variant used by ZeroMQ, using a different character set (without quotes and other special characters), without delimiters, and is more suitable for embedding in strings.
Base85 is encoding, not encryption. Anyone can decode it and it provides no data confidentiality. It is only used to convert binary data into printable ASCII text for transmission in text-based environments. For secure transmission, use AES or similar encryption algorithms with HTTPS.
Base85 is primarily used in the following scenarios: Adobe PDF internal stream data encoding, PostScript language binary data encoding, Git version control binary patches (binary diff), ZeroMQ message transmission protocol, and firmware transmission in some embedded systems.
Common Base85 decoding errors include: characters not in the valid character set (Adobe Ascii85 uses '!' to 'u', Z85 uses a different set), incorrect block length (should be multiples of 5, with special handling for the last block), and missing <~ and ~> delimiters (Adobe format). This tool automatically detects and provides detailed error messages.
Yes, but character escaping needs to be considered. Adobe Ascii85 may contain characters that JSON needs to escape (such as backslashes and double quotes). The Z85 format is specifically designed to avoid such issues, using a character set without JSON special characters, making it more suitable for embedding in JSON. When using this tool, you can select the Z85 format for better JSON compatibility.
Yes. This tool supports uploading any file (such as images, PDFs, executables, etc.) for Base85 encoding, and the encoded result can be saved as a text file. You can also decode Base85 encoded text back to a binary file and download it. All processing is done locally in the browser; files are not uploaded to the server.
Base85 encoded data is about 25% larger than the original binary data, while Base64 increases by about 33%. Therefore Base85 saves about 8% space compared to Base64. For example, 100KB of binary data encoded with Base85 is about 125KB, while Base64 encoding is about 133KB. Although the savings percentage is modest, it still provides a significant advantage when transmitting large amounts of data.