Information theory calculator
Measure information: entropy of any text or probabilities, build a Huffman code with its tree, and work out channel capacity from bandwidth and noise.
How to use
- Text entropy & Huffman: type or paste text and choose whether to count characters or words. You get the entropy (the average information per symbol), a Huffman code for every symbol, and how many bits the whole text needs.
- From probabilities: list symbols with their probabilities (0.25), percentages (25 %) or counts; they are scaled to add up to 1.
- Channel capacity: type a bandwidth and signal-to-noise ratio for the Shannon-Hartley limit, or the share of bits that noise flips for a binary channel.
- Read the tree from the top: each step left adds a 0 to the code, each step right adds a 1.
Keyboard and touch
| Tab | Move between tabs, boxes and buttons |
| Enter or Space on a tab | Open that tab |
| Typing in the text box | Updates the results as you type |
Tips
- Entropy is highest when every symbol is equally likely and zero when one symbol is certain. A fair coin carries 1 bit; a coin that lands heads 90 % of the time carries only 0.47.
- No code without errors can average fewer bits per symbol than the entropy; Huffman coding gets within 1 bit of it, often much closer.
- English text is around 4.1 bits per letter when letters are counted one at a time, but real compressors do far better because they use context, which this single-symbol count ignores.
- Every 3 dB of signal-to-noise roughly doubles the signal power; at high SNR each extra 3 dB adds about 1 bit per second per hertz.
- A binary channel that flips half the bits carries nothing at all: the output is pure noise.
About this calculator
Entropy H = −Σ pi log₂ pi (Shannon, 1948); the self-information of one symbol is −log₂ p. Huffman's algorithm (1952) repeatedly joins the two least likely symbols, which gives a prefix code with the shortest possible average length for symbol-by-symbol coding; ties are broken in a fixed order, so other equally good codes exist. Efficiency = entropy ÷ average code length. Text is counted by Unicode character (or by word), with probabilities from the counts in the text itself.
Channel capacity: Shannon-Hartley C = B log₂(1 + S/N), with S/N as a power ratio (10dB/10). A binary symmetric channel that flips bits with chance p has capacity 1 − H(p) bits per bit sent. These are theoretical limits. Everything runs in your browser; your text is not sent anywhere.