Quantify uncertainty, information content, and randomness. Compute entropy from probability distributions or any text input. Visualize probability mass and entropy decomposition — fundamental for communication theory, AI, and statistical inference.
Claude Shannon, the father of information theory, introduced entropy in his landmark 1948 paper "A Mathematical Theory of Communication". Shannon entropy measures the average level of "information" or "uncertainty" inherent in a random variable's possible outcomes. For a discrete distribution with probabilities p₁, p₂, …, pₙ, entropy H is defined as:
Entropy reaches its maximum when all outcomes are equally probable (maximum uncertainty), and minimum (zero) when one outcome is certain. This concept revolutionized data compression (source coding theorem), cryptography, statistical inference, and even machine learning (decision trees use information gain, i.e., entropy reduction).
In Probability mode, you provide weights or probabilities (e.g., "0.3,0.7" or raw counts "2,5,3"). The engine normalizes them, removes zeros, and computes H = -∑(p_i * log₂(p_i)). The chart displays the probability mass function. In Text mode, the tool counts character frequencies (including spaces, digits, punctuation), builds the empirical distribution, and computes the entropy of the message. High textual entropy indicates unpredictability, while low entropy suggests redundancy or patterns.
Meteorologists use entropy to quantify forecast uncertainty. Suppose a location has three weather states: sunny (0.7), rainy (0.2), cloudy (0.1). The Shannon entropy H = 1.156 bits, indicating moderate predictability. If new data splits into morning/afternoon, the conditional entropy might drop — this information gain measures the value of additional sensors. Our calculator helps benchmark uncertainty before and after model refinements.
| Probability distribution p(x) | Entropy (bits) | Interpretation |
|---|---|---|
| Deterministic (1, 0, 0, ...) | 0.000 | No uncertainty |
| Fair coin (0.5, 0.5) | 1.000 | 1 bit per toss |
| Biased coin (0.9, 0.1) | 0.469 | Less surprising on average |
| Fair die (6 outcomes, p=1/6 each) | 2.585 | ~2.585 bits/roll |
| English text (character entropy ~4.0‑4.5 bits) | ≈4.1 (empirical) | Redundancy due to language patterns |
Shannon's entropy shares formal similarity with Boltzmann‑Gibbs entropy in statistical mechanics, though they apply to different domains. Both quantify disorder or uncertainty. The concept has been extended to quantum information, relative entropy (Kullback‑Leibler divergence), and differential entropy for continuous variables.