๐ค Base85 (Ascii85) Converter
87cURD_*#4DfTZ)+T
Encodes text into Ascii85 (Base85) format, or decodes an Ascii85 string back to text. Base85 represents binary data about 7% more efficiently than Base64, and is used for embedding binary data in PostScript and PDF files.
How to use
- Choose the "Encode" or "Decode" tab.
- Enter the text or Ascii85 string you want to convert.
- The result appears automatically โ click "Copy" to copy it to your clipboard.
How the calculation works
Base85 represents data with 85 characters. This tool implements Ascii85, the form used in Adobe PostScript and PDF. Each 4 bytes (32 bits) are treated as one number and written as 5 base-85 digits. Since 85โต is about 4.4 billion, enough for 32 bits (about 4.3 billion), 4 bytes become 5 characters โ about 1.25 times the size, less overhead than Base64 (3 bytes to 4 characters). Characters run from "!" (33) to "u" (117), and a group of four zero bytes is shortened to "z". A final group of fewer than 4 bytes is padded with zeros for the calculation, then only the needed characters are kept. When decoding, whitespace, line breaks and Adobe's <~ ~> delimiters are ignored.
Worked example
"Man is distinguished" โ 9jqo^BlbD-BleB1DJ+*+F(f,q The first 4 bytes "Man " (0x4D616E20 = 1,298,230,816) in base 85 are 24, 73, 80, 78, 61 adding 33 gives the characters 9 j q o ^ Four zero bytes: 00 00 00 00 โ z
Things to be aware of
- Other Base85 variants, such as ZeroMQ's Z85 and the one in Git binary patches, use different alphabets. This tool handles Ascii85 only.
- Ascii85 includes characters such as " and \, so it does not drop straight into JSON or URLs.
- If the decoded bytes are not valid UTF-8 (binary data), they cannot be shown as text.
FAQ
What's the difference between Base64 and Base85?
Base64 converts 3 bytes into 4 characters (75% efficiency), while Base85 converts 4 bytes into 5 characters (80% efficiency), representing binary data more compactly.
Why does a "z" character sometimes appear?
The Adobe variant of Ascii85 has a special rule: a 4-byte group that's entirely zero is shortened to a single "z" character.
Where is this used?
It's commonly used to embed binary data (like images) as text inside PostScript and PDF files.