Ascii85 and Base85 encoder and decoder
Paste text or hex bytes to get their Ascii85 form, or switch to Decode. Choose the Adobe format with <~ and ~> markers, plain Ascii85 or Z85, and decide whether four zero bytes are written as z.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Choose Encode or Decode and pick a Format.
- Choose whether the bytes are Text (UTF-8) or Hex bytes.
- For Ascii85, decide on the z shortcut for zero groups.
- Copy the result.
How it works
Four bytes form a 32-bit number. It is divided by 85 repeatedly to give five digits, and each digit becomes the character with code 33 plus the digit (Z85 uses its own alphabet). A final group of n bytes gives n + 1 characters, and decoding pads that group with the highest digit before dropping the extra bytes.
Example: Man is the bytes 4D 61 6E 20, the number 1298230816, and encodes to 9jqo^. With the Adobe wrapper it is <~9jqo^~>.
Tips and common mistakes
- Whitespace and line breaks inside the encoded text are ignored when decoding.
- The Adobe markers are optional when decoding.
- In Z85, the bytes 86 4F D2 6F B5 59 F7 5B become
HelloWorld, the example in the ZeroMQ specification.
Frequently asked questions
What is Ascii85?
Ascii85, also called Base85, writes 4 bytes as 5 printable characters (code 33 to 117). It is about 25 percent larger than the input, against about 33 percent for Base64. It is used in PostScript and PDF streams (with <~ and ~> markers) and in some Git patch formats with a different alphabet.
What does the z shortcut do?
In Ascii85 a group of four zero bytes can be written as the single character z instead of !!!!!. Decoders of the Adobe form accept it. Turn it off if the receiving program does not.
What is Z85?
Z85 is the ZeroMQ variant (RFC 32). It uses a different 85-character alphabet without quotes or backslash, so it can sit inside source code and JSON, and it requires a multiple of 4 bytes.
Are other variants such as btoa supported?
No. The old btoa file format with its xbtoa header and y shortcut is not covered, nor the RFC 1924 or Git alphabets. This tool covers plain Ascii85, the Adobe wrapper and Z85.
Is my data sent to a server?
No. The conversion happens in your browser.