Huffman Coding — 2D
Input text
Preset
abracadabra
mississippi
huffman coding
aaaaabbbcc (skewed)
abcdefgh (uniform)
aaaaaaaaaa (single symbol)
Build tree
Step merge ▸
Auto ▶
Reset ↺
Symbols
—
Total characters
—
Original bits (8/sym)
—
Compressed bits
—
Compression ratio
—
Avg code length
—
Press "Build tree" to count frequencies and start merging.
Greedy min-heap: each step pops the two lowest-frequency nodes and merges them into a parent, until one root remains. Left edge = 0, right edge = 1.