WOLFRAM|DEMONSTRATIONS PROJECT

Huffman Coding

​
code 1
code 2
code 3
code 4
mode
show
steps
decode
next step
previous step
fixed word
word
1
random word
check answer
try again
show
answer
letter
code
A
11
B
010
C
0111
D
00
E
10
F
0110
Decode this string:
11011110
​
Huffman coding is a method of data compression that assigns shorter code words to those characters that occur with higher probability and longer code words to those characters that occur with lower probability. A Huffman code is an example of a prefix code—no character has a code word that is a prefix of another character's code word. In the "show steps" mode, this Demonstration illustrates the step-by-step procedure for finding the Huffman code for a set of characters with given probabilities. The "decode" mode gives the user an opportunity to decipher strings that have been encoded using the Huffman code.