01What is Base85 Encoder?
Base64 is the default way to squeeze bytes into printable text, but it costs you about a third more space. Base85 does better. It packs every 4 bytes into 5 printable characters, so the overhead drops to about 25%. The catch is that Base85 comes in several flavours, and they don't decode each other's output. This tool implements one of them: Adobe Ascii85. That's the encoding behind the ASCII85Decode filter in the PDF specification and the matching filter in PostScript. It's also what Python returns from base64.a85encode(data, adobe=True). Here is how the encoder works. Your text is turned into UTF-8 bytes with the browser's TextEncoder. Each group of 4 bytes is read as one 32-bit number and written as five base-85 digits. The digits are the 85 characters from ! (code 33) to u (code 117). Two special rules follow the Adobe spec. A group of four zero bytes is written as a single z instead of !!!!!. A short final group is padded with zeros for the maths, then trimmed, so a tail of n bytes becomes n + 1 characters. The finished string is wrapped in <~ and ~>. A quick worked example. The word Man is 3 bytes, so it becomes the 4 characters 9jqo, and the page shows <~9jqo~>. Café is 5 bytes in UTF-8 because é takes two bytes. One full group plus a 1-byte tail gives 5 + 2 characters: <~6XaTEW;~>. Decode mode is forgiving about formatting. The delimiters are optional, and spaces and line breaks are stripped first, so you can paste a wrapped block straight out of a PDF. Each z expands back to four zero bytes. The tool then gives you a specific error when something is off: a character outside ! to u, a final group with only one character, a group whose value is too big for 32 bits, or bytes that don't form valid UTF-8. That last check is the main limit. Output is shown as text, so binary payloads such as a Flate-compressed PDF stream or an image won't decode here. Encoding is text-only too. You can't load a file. The tool also doesn't speak ZeroMQ's Z85 or the RFC 1924 alphabet that Git uses in binary patches. Those use different characters and have no z shortcut. Conversion happens in your browser tab, so the PDF snippet you paste isn't uploaded.
Developers digging into PDF and PostScript internals, and engineers writing or testing their own Ascii85 codecs. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Base85 Encoder
- Choose Encode or Decode at the top of the tool.
- Type or paste into Text Input (encode) or Base85 Input (decode). When decoding, the <~ ~> delimiters and line breaks are optional.
- Read the result in the Base85 Output or Decoded Text panel, with its character count. Errors say exactly what is wrong.
- Click Copy to take the output, or the reset icon to clear the box.
- Pick one of the sample inputs (Hello World, Binary data, Special chars) to see the encoder on known text.
03Worked examples
- Input:
Encode: Hello, World! - Result:
<~87cURD_*#4DfTZ)+T~> - 13 bytes: three full groups (15 characters) plus a 1-byte tail (2 characters).
- Input:
Encode: Man - Result:
<~9jqo~> - 3 input bytes become 4 output characters. A final partial group of n bytes is written as n + 1 characters.
- Input:
Encode: Café - Result:
<~6XaTEW;~> - é is 2 bytes in UTF-8, so Café is 5 bytes and needs 7 characters.
- Input:
Encode four zero bytes (\0\0\0\0) - Result:
<~z~> - An all-zero 4-byte group is shortened to z instead of !!!!!.
- Input:
Decode: 9jqo^ (no delimiters) - Result:
Man - A full 5-character group gives 4 bytes, here M, a, n and a space.
- Input:
Decode: <~h8~> - Result:
Error: the decoded bytes are not valid UTF-8 text - The 2-character group decodes to a single byte that is not valid UTF-8 on its own.
04Common use cases
- Decoding a <~ ... ~> block copied out of an uncompressed PDF or PostScript file to read the text inside
- Producing Ascii85 test fixtures for your own encoder, including the z shortcut and partial final groups
- Checking what Python's base64.a85encode(data, adobe=True) should return before you write an assertion
- Comparing output length against Base64 for the same string in an encoding design review
- Working out why a hand-edited Ascii85 string fails to parse, using the specific error messages
- Showing students how 4 bytes map to 5 base-85 digits with a short, readable input
05Tips
- Python's base64.a85encode leaves out the <~ ~> delimiters unless you pass adobe=True. The decoder here accepts either form.
- Ascii85 output can contain quotes, backslashes, < > and &. Escape it before dropping it into JSON, XML, HTML or a shell string.
- The z shortcut only applies to a full group of four zero bytes that starts on a 4-byte boundary. Three trailing zeros are written out normally.
- If decoding fails with the UTF-8 error, the data was probably binary, like a compressed PDF stream. Python's base64.a85decode will give you raw bytes instead.
- Z85 and Git's RFC 1924 alphabet use the same arithmetic but different characters, so output from here won't decode there.
06Related concepts
Ascii85, PDF ASCII85Decode, Base64, Binary-to-text encoding, Z85.
Frequently Asked Questions
What is Base85 Encoder?
Base85 Encoder is a free, browser-based developer tool on AIDToolStack. Encode/decode Base85 (Ascii85) It requires no installation or sign-up and works entirely in your browser.
Is Base85 Encoder free to use?
Yes. No sign-up, no fees and no usage cap.
Does Base85 Encoder store my data?
No. It runs in your browser; nothing is uploaded.