Kind85 — a forgiving text encoding

A few years ago I asked a question: could we write music in a book — have a reader type it in, and get music out the other end?

Kind85 is the yes. It packs 4 bytes into 5 characters (Ascii85's density) and forgives look-alike typos (Crockford Base32's kindness) — a combination that didn't previously exist, built so a printed book could carry a compressed song a reader types back into a playable MIDI. Type below and watch it work.

↓  encode  ↓

In the book, a reader hand-types 35 short lines, which decode into a 1.4 KB compressed package with a 6.4 KB MIDI inside — sheet-music-like instructions shrink 4.6×.

Thirty-five lines sounds unrealistically small, so here's the arithmetic: each printed line fits the book page's 64-character width — a 2-digit line number, a 50-character payload printed as five 10-character groups (the spaces aren't data; the decoder strips them — they're kindness for the typist), and a 4-character checksum. Every 5 Kind85 characters carry 4 bytes. The song fills 1,750 payload characters across the 35 lines, and (1,750 × 4) ÷ 5 = 1,400 bytes: a 4-byte length header plus a 1,396-byte lzma package. Decompressed, that package becomes the 6,367-byte, four-track, 32-second MIDI. The typing is just delivery — compression did the heavy lifting.

That's the insane ratio on display: as instructions, the whole song travels in 1,400 bytes. As audio, the same song is 384,813 bytes — 275× bigger. So why serve audio at all? Because MIDI has a catch: your computer's synthesizer performs it, and it sounds a little different on every machine. This page reconstructs the MP3, rendered once on the Microsoft GS Wavetable synth, so you hear the song the way it was intended. And since a recording won't shrink (zlib got just 0.8% off — it's already compressed), the audio version needs 8,525 checksummed lines instead of 35. Nobody hand-types that — so this page types it for you. Everything below is the entire song as Kind85 text. Press the button and the real pipeline runs in your browser: every line's checksum verified, glyphs decoded back to bytes, inflated, played. Suspicious? Open DevTools — the Network tab stays silent; the player's src is a data: URI minted in your browser, audio that never touched the network. Or skip DevTools: hit the vandalize button — or click into the text and break it yourself. Edit a character, delete a whole line; the machine names exactly what you hurt.

Music by Jaweazy, rendered on the Microsoft GS Wavetable synth it was written for.

Each line carries its line number folded into a CRC-32 checksum, so a genuine typo is caught on the spot, a misplaced line is rejected, and lines can arrive in any order — the same scheme the printed book uses. Strict encoder, forgiving decoder — Postel's Law. ~40 lines of original code on borrowed, battle-tested parts. Want it? The code is free — MIT, no strings ↗