Huffman Coding

Type text and it builds the prefix code: common characters get short codes, rare ones get long ones. Entropy gives the floor it is aiming at.

Bits saved

Encoded bitstring

Nothing to encode yet.

Code table, most frequent first
The tree

Filled circles are characters, open circles are merged nodes, and the number inside each is its frequency. Follow a path down from the root and read off the 0s and 1s to get a character's code.