User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
0 characters
0 characters
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Base64 inflates binary data by approximately 33% because it maps every 3 bytes to 4 ASCII characters using a 64-symbol alphabet. Ascii85 (also called Base85 or btoa encoding) reduces that overhead to roughly 25% by encoding 4 bytes into 5 characters drawn from a 85-character range (! through u, ASCII codes 33 - 117). The format was adopted by Adobe PostScript and PDF internals, where every kilobyte of payload size matters for render performance. This tool performs real byte-level conversion between the two encodings. It does not transliterate strings; it decodes one encoding to its raw binary form and re-encodes it in the target format. Malformed input - wrong character sets, broken padding, or missing <~~> delimiters - will produce a specific validation error rather than silent corruption.

base64 ascii85 btoa encoding base85 encoding converter binary to text

Formulas

Ascii85 encodes a group of 4 bytes into 5 printable ASCII characters. The 4 bytes are treated as a big-endian 32-bit unsigned integer N, then decomposed by successive division by 85:

N = b0 โ‹… 2563 + b1 โ‹… 2562 + b2 โ‹… 256 + b3
c4 = N mod 85 + 33
c3 = โŒŠN รท 85โŒ‹ mod 85 + 33
c2 = โŒŠN รท 852โŒ‹ mod 85 + 33
c1 = โŒŠN รท 853โŒ‹ mod 85 + 33
c0 = โŒŠN รท 854โŒ‹ + 33

Where b0โ€ฆb3 are the input bytes (big-endian order), c0โ€ฆc4 are the output ASCII code points, and 33 is the offset to shift into printable range (starting at !). If N = 0, the entire 5-character group is replaced with the single character z. For a trailing group of n bytes (1 - 3), pad with zero bytes to 4, encode normally, then output only the first n + 1 characters.

Reference Data

PropertyBase64 (RFC 4648)Ascii85 (btoa / Adobe)
Alphabet size64 symbols85 symbols
Character rangeA - Z, a - z, 0 - 9, +, /ASCII 33 (!) to 117 (u)
Padding character= (up to 2)None (length-implied)
DelimitersNone<~ ... ~>
Input block size3 bytes4 bytes
Output block size4 characters5 characters
Expansion ratio4รท3 1.3335รท4 = 1.25
Size overhead 33.3% 25%
Zero-block shortcutNoz = 4 null bytes
Whitespace handlingIgnored by most decodersIgnored between delimiters
Primary use caseEmail (MIME), URLs, JSON, XMLPostScript, PDF streams
Defined inRFC 4648 (2006)btoa(1) Unix, Adobe spec (1992)
URL-safe variantYes (- and _ replace + and /)No standard variant
Bits per character66.41 (log285)
Max encodable value per block224 โˆ’ 1232 โˆ’ 1
Binary safetyYesYes

Frequently Asked Questions

Base64 uses a 64-symbol alphabet, encoding 6 bits per character. Ascii85 uses 85 symbols, encoding log2(85) โ‰ˆ 6.41 bits per character. Over a 4-byte block, Base64 needs 8 characters (including padding) while Ascii85 needs only 5. The net overhead drops from 33.3% to 25%. For a 1 MB file, that saves roughly 85 KB.
This converter will attempt to process the raw data without delimiters, stripping whitespace and treating the content as a bare Ascii85 stream. However, this is technically non-conformant with the Adobe specification. If your data originates from a PDF or PostScript file, the delimiters should be present. Missing delimiters can indicate a truncated or corrupted stream.
When a full 4-byte input group consists entirely of zero bytes (0x00000000), the encoder replaces the 5-character output !!!!! with the single character z. This provides additional compression for null-heavy data. The shortcut is never applied to partial trailing groups. During decoding, each z expands to 4 null bytes.
Yes. Both Base64 and Ascii85 operate on raw byte arrays, not character strings. The converter decodes Base64 to bytes via a binary string intermediary, preserving all 256 possible byte values. No UTF-8 interpretation is applied to the intermediate binary. The output encoding then maps those bytes without loss. If you paste the final Ascii85 into a system that expects UTF-8 text, it remains valid because all Ascii85 characters fall within the ASCII printable range.
A single group encodes 4 bytes, representing values from 0 to 232 โˆ’ 1 = 4,294,967,295. The highest valid Ascii85 group is s8W-! which decodes to 0xFFFFFFFF. Any 5-character group that decodes to a value exceeding this limit is invalid and will produce a decoding error.
Yes. Trailing bytes are padded with 0x00 on the right to form a complete 4-byte block. After encoding, only the first n + 1 characters are emitted (where n is the number of real bytes: 1 - 3). During decoding, a short final group is padded with u (the highest Ascii85 character, value 84) on the right to 5 characters, decoded to 4 bytes, and then truncated to the correct count.