DATA COMPRESSION SIMULATION

▸ Counting source symbol frequencies…
▸ Building a priority queue by frequency
▸ Building the Huffman tree (merge the 2 smallest)…
▸ Assigning prefix codes 0/1 along the edges
▸ Computing Shannon entropy H = −Σ p·log₂p
▸ Ready — Online. ✅
0%
⌂ Mind & Machine

Simulation room Data Compression

Data Compression & Huffman Coding
Online
Huffman · entropy · ratio
Compression gauge
🗜️ Compression ratio
Raw bits
Compressed bits
Ratio
Entropy H
Avg code length
Symbols
Notes
The Huffman tree gives a short code to common symbols and a long code to rare ones → the average bits approach the entropy H — the theoretical limit of lossless compression.
Pick a ‘Scenario’ (skewed / uniform / runs / lossy…) · click a symbol or concept for details
Your browser has canvas disabled.
Actual vs ideal (Shannon) bits per symbol actual bits (Huffman code)ideal bits −log₂(p)