Follow a word from its character frequencies to a complete Huffman tree and a sequence of bits. Huffman Lab accompanies the FreeFlower notes on compression. The visualiser and its explanations are in German.
Build the tree step by step
Enter a word or a short text. The visualiser reads it from left to right and displays absolute and relative character frequencies. Each distinct character starts as a leaf. The two trees with the lowest frequencies are joined, repeatedly, until a single tree remains.
A short explanation appears beside every step. Select any step, move forwards or backwards, or play the animation at an adjustable speed. The “Alles zeigen” button displays the complete result immediately.
Aligned with the lesson notes
The starting example, ALLEMAL, comes from the FreeFlower compression notes. Equal frequencies are resolved by choosing the shallower tree. For this example, the branch arrangement and codes match the solution in the notes. Left branches represent 0, right branches 1. The path from the root to a leaf gives its character code.
The result displays the code table and the encoded text. The size comparison uses a fixed-width code for the alphabet of that text. It excludes storage of the code tree, as explained beside the result.
Screenshot
The capture shows ALLEMAL and its complete Huffman tree. Select the image to enlarge it.
Use in class
Use the visualiser for a classroom demonstration or individual experiments. Students can predict which trees will be joined next, then check the decision. Different words illustrate how character frequencies affect code lengths.
Related materials are described on the FreeFlower project page.