Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Kraft inequality

The exact condition on a set of proposed codeword lengths that tells you whether a prefix code with those lengths can actually exist.

A prefix D-ary code with codeword lengths l_1,\ldots,l_k exists if and only if \sum_i D^{-l_i} \leq 1.

See also

Read the full section →
Graph settings

Calculator