PPolySim OS
For Hobbyists & Makers · Huffman Coding

Huffman Coding for a password hash

Built for hobbyists & makers exploring it for fun. Play with real physics and math, no license and no setup — just open and tinker. Simulate a password hash live below — adjust the inputs and watch it respond, right in your browser.

Huffman CodingLive
Codebook (shorter = more frequent)
a
×5
0
1 bit
c
×1
100
3 bit
d
×1
101
3 bit
b
×2
110
3 bit
r
×2
111
3 bit

Controls

Huffman coding gives frequent symbols short codes and rare ones long codes, minimizing the total bits — the optimal prefix code. It builds a tree by repeatedly merging the two least frequent nodes, so no code is a prefix of another and decoding is unambiguous. It is the compression step inside ZIP, JPEG, MP3, and countless file formats.

▶ Run in Python

Data Inspector

Symbols5
Huffman bits23
Fixed-length bits33
Compression70%

Governing equation

Reading this result: Huffman packs this text into 23 bits versus 33 fixed-length — a 30% saving, earned by giving the most frequent symbol (a, ×5) the shortest code.

Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.

or unlock everything with Pro →

More with Huffman Coding

Frequently asked questions

Is this good for hobbyists & makers?
Yes — this version of "Huffman Coding for a password hash" is framed for hobbyists & makers exploring it for fun. Play with real physics and math, no license and no setup — just open and tinker.
Do I need to install anything?
No. It runs in any modern browser, free, with no account required.