Ascii85 (Base85) encoder

Every 4 bytes become 5 characters, about 7% shorter than Base64.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter text and wrap in <~ ~>.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Each 4 bytes are read as a 32-bit number, written in base 85 as 5 digits, and 33 is added to each digit to give a character from ! to u. An all-zero group is written z; a short final group is padded with zeros and its output is cut by the same amount.

Example

Inputs: Wrap in <~ ~> = no. Result: Ascii85: 9jqo^BlbD-BleB1DJ+*+F(f,q; Bytes: 20.

Man is distinguished
9jqo^BlbD-BleB1DJ+*+F(f,q

Limits and caveats

  • Adobe/btoa flavour only; Z85 and the Git/RFC 1924 Base85 alphabets are different.
  • The y shortcut for spaces used by some old variants is not produced.

Questions about this tool

How does Ascii85 compare with Base64?

Ascii85 turns 4 bytes into 5 characters while Base64 turns 3 into 4, so Ascii85 is shorter but uses symbols such as " and \.

Why is there a z in the output?

It is shorthand for four zero bytes in a row instead of !!!!!.

When should I use the <~ ~> wrapper?

In PostScript and PDF streams, or whenever the start and end of the data need to be marked clearly.