🔓 Base85 Decoder – Decode ASCII85, Z85 & RFC 1924 Strings
The Base85 Decoder reverses Base85 encoding, converting encoded ASCII strings back to their original binary or text form. Base85 encodes every 4 bytes of binary data into 5 printable ASCII characters, achieving roughly 25% overhead — significantly better than Base64's 33%. This decoder handles all three widely-used variants: ASCII85 (Adobe/PostScript), Z85 (ZeroMQ), and RFC 1924.
🧮 How Base85 Decoding Works
Each group of 5 Base85 characters is interpreted as a base-85 number (digits 0–84), yielding a 32-bit unsigned integer. That integer is then split into 4 big-endian bytes. For partial groups at the end of the input, padding characters fill the missing positions, and only the needed bytes are kept.
The core formula for a 5-character group c₀ c₁ c₂ c₃ c₄ is:
n = d₀×85⁴ + d₁×85³ + d₂×85² + d₃×85 + d₄
bytes = [n≫24, (n≫16)&0xFF, (n≫8)&0xFF, n&0xFF]where dᵢ is the alphabet index of character cᵢ.
📚 Supported Variants
ASCII85 (Adobe)
Uses characters ! through u (ASCII 33–117). Optional <~ and ~> delimiters are auto-stripped. The z shorthand expands to five ! chars (four zero bytes). Used in PDF streams and PostScript files.
Z85 (ZeroMQ)
Uses a URL-friendly character set defined by the ZeroMQ specification. Input length must be a multiple of 5. Commonly used for binary key material and message payloads in ZMQ protocols.
RFC 1924
Defined for compact IPv6 address representation. Uses digits, uppercase, lowercase, and 23 symbols. Less common in practice but useful for encoding large integers and compact binary payloads.
💡 Common Use Cases
- PDF & PostScript streams — Decode embedded binary payloads (images, fonts, compressed streams) from PDF files.
- Git binary patches — Git uses ASCII85 to encode binary file diffs in patch format.
- ZeroMQ messages — Decode Z85-encoded keys and binary message frames from ZMQ applications.
- Security research — Decode Base85-obfuscated payloads found in malware analysis, CTF challenges, or protocol inspection.
- General binary embedding — Any protocol or format that uses Base85 to safely transport binary data in text contexts.
🔍 Output Modes
The decoder offers two output modes. UTF-8 Text tries to interpret the decoded bytes as a readable string — ideal when the original data was text. Hex Dump shows the raw bytes in a formatted grid with offsets, hex octets, and an ASCII sidebar — essential for inspecting binary payloads like images or compiled code.
\xNN) in text mode and highlights this with a warning. Use hex dump mode for full byte-level inspection.⚡ Size Efficiency: Base85 vs Base64
Base85 produces approximately 20% smaller encoded text than Base64 for the same binary payload. A 1 MB binary file encodes to ~1.25 MB in Base85 vs ~1.33 MB in Base64. This is because Base85 maps 4 binary bytes to 5 text characters (ratio 5/4 = 1.25), while Base64 maps 3 bytes to 4 characters (ratio 4/3 ≈ 1.33).
🔒 Privacy & Security
All decoding runs entirely in your browser using client-side JavaScript. No encoded input is transmitted to any server. Base85 is not encryption — it is a reversible encoding scheme that provides no confidentiality. For sensitive data, always apply proper encryption (e.g., AES) in addition to encoding.