ASCII85 to Base64 Converter
Convert ASCII85 (Base85) encoded data to Base64 and back. Supports Ascii85 z-abbreviation, file upload, and instant bidirectional conversion.
About
ASCII85 and Base64 are binary-to-text encoding schemes with different density characteristics. ASCII85 encodes 4 bytes into 5 characters (a 25% overhead), while Base64 encodes 3 bytes into 4 characters (a 33.3% overhead). Converting between them requires full binary round-tripping: the source encoding is decoded to raw bytes, then re-encoded in the target format. A character-level transliteration is not possible because the two schemes use incompatible group sizes and arithmetic bases.
Incorrect conversion - truncating padding, mishandling the z zero-group abbreviation, or confusing Adobe's <~ / ~> delimiters with payload data - corrupts the binary stream silently. This tool performs byte-accurate decoding with strict validation: out-of-range characters (< 33 or > 117 in ASCII), illegal z placement inside partial groups, and overflow past 232 − 1 are all caught and reported. This tool approximates lossless conversion assuming well-formed input conforming to the btoa specification (RFC 1924 variant excluded).
Formulas
ASCII85 encodes a 4-byte block as a base-85 big-endian number spread across 5 characters, each offset by 33 to stay in the printable ASCII range.
where b0…b3 are the input bytes and c0…c4 are the output ASCII codes. Valid output characters range from ! (ASCII 33) to u (ASCII 117). A special abbreviation z represents four zero bytes (value = 0).
Base64 encodes 3 bytes into 4 characters by splitting 24 bits into four 6-bit indices into the alphabet A - Z, a - z, 0-9, +, /.
The conversion pipeline is: Source Encoding → Raw Byte Array → Target Encoding. No shortcut exists because the group boundaries of 4-byte (ASCII85) and 3-byte (Base64) blocks are co-prime.
Reference Data
| Property | ASCII85 (Base85) | Base64 |
|---|---|---|
| Character Set | 85 printable ASCII (! to u) | 64 chars: A - Z, a - z, 0-9, +, / |
| Encoding Ratio | 4 bytes → 5 chars | 3 bytes → 4 chars |
| Size Overhead | 25% | 33.3% |
| Padding | Implicit (short final group) | Explicit (= or ==) |
| Zero Compression | z → 4 zero bytes | None |
| Delimiters (Adobe) | <~ ... ~> | None |
| Whitespace | Ignored between chars | Ignored (per RFC 2045) |
| Common Use | PostScript, PDF streams | Email (MIME), Data URIs, JWT |
| Base Radix | 85 | 64 (26) |
| Bits per Char | 6.41 bits | 6.00 bits |
| Group Size (input bytes) | 4 | 3 |
| Group Size (output chars) | 5 | 4 |
| Max Value per Group | 855 − 1 = 4,437,053,124 | 224 − 1 = 16,777,215 |
| RFC / Standard | No formal RFC (Adobe spec) | RFC 4648 |
| URL-Safe Variant | Z85 (ZeroMQ) | Base64url (- and _) |
| Efficiency vs Hex | 2× more compact | 1.5× more compact |
| Binary Safety | Yes (all printable) | Yes (all printable) |
| Sorting Preserves Order | Yes (ASCII order = numeric) | No (alphabet mapping differs) |
| Line Length Convention | 80 chars (Adobe) | 76 chars (MIME RFC 2045) |