🌳 CIS 22C · Honors Project

Huffman Encoding

Type anything and watch the frequency table, tree, codes, and compression build — live, in your browser.

Text→ Hash Table→ Sorted List→ Binary Tree→ Codes

A faithful browser port of a C++ honors project.

Try:

2 · Frequencies

Counted via a 256-slot direct-address hash table — O(1) per character.

CharFreq

4 · Huffman codes

Frequent characters get shorter codes. Prefix-free — no code is a prefix of another.

CharFreqHuffmanASCII

3 · Huffman tree

Greedy merges of the two lightest nodes. ● leaf · ● internal · edge 0 = left, 1 = right.

Show merge steps

    5 · Encoded output

    6 · Decode

    Paste a 0/1 bit string. It walks the current tree to recover text.