tool · Apr 2026
πCompress
A data compression tool that reliably makes files bigger, by looking your bytes up inside the first million digits of π.
A “compression” tool built on the idea that the digits of π contain every possible finite sequence of numbers — so rather than storing your data, you can just store where to find it in π.
It works. The output is consistently larger than the input.
The algorithm
- Convert each byte of the input to its two-digit hex representation —
Hbecomes0x48becomes"48". - Search for that hex string inside the first million digits of π.
- Take the greedy longest match: the largest chunk of input whose hex representation appears in π.
- Verify the run found in π actually converts back to the original bytes. This step exists because skipping it produced hilarious but incorrect results.
- Emit instructions rather than data —
Pi[index] (N bytes)for a hit, orRaw[0xHH]for a byte that couldn’t be found.
Pi[45219] (2 bytes)
Raw[0x4a]
Pi[901] (3 bytes)
Raw[0x8b]Every hit costs an index — often 6 digits — to encode two bytes. Every miss costs the original byte plus the framing. Both directions lose.
Why
Mostly to find out. The premise that π is a normal number is genuinely unproven, and building the thing that depends on it is a faster way to understand why that matters than reading about it.
Written in Rust, which was the actual point: a million-digit search per chunk is the kind of hot loop where the language choice shows up immediately.