visual-cs

LZ77 Compression — Sliding Window

← All visualizations

LZ77 Compression Explorer

Watch the sliding window scan the input character by character. The search buffer holds already-encoded data; the lookahead buffer holds what's next. Each step emits a (offset, length, next-char) token.

12
6
Speed
Step
Full input string
Window view
Search buffer (already encoded)
Lookahead buffer
Run compression to begin…
Output tokens
#
Match in buffer
Offset
Length
Next
Decoded segment
Input size
characters
Tokens emitted
triples
Chars via back-ref
copy from buffer
Compression ratio
tokens / chars