Compression Explorer — RLE & LZ78

Type a string and watch run-length encoding and an LZ78 dictionary build the compressed output one step at a time.

Input string

Playback

0 / 0
1.0×

How to read it

RLE collapses each run of identical characters into a count + character token. Great for long runs — but a token costs ~2 bytes, so text without runs actually expands.

LZ78 builds a dictionary of phrases it has seen. Each token points at a previous phrase plus one new character, so repeated words compress even when no single character repeats.
Run-Length Encoding · RLE

LZ78 Dictionary · LZ

Prompt

Ratios use a simple bit model: original = 8 bits/char; RLE token = 16 bits (count + char); LZ78 token = ⌈log₂(dict size)⌉ index bits + 8 char bits.