How to use
Choose Counts when you have frequencies such as 10, 20 and 30. Choose Probabilities when every entry is already a probability and the total is 1. Enter two to one hundred nonnegative values separated by spaces, commas or semicolons, then calculate. Category names are not needed: result positions 1, 2 and 3 correspond to the first, second and third inputs.
The pale count example 10, 20, 30 can be calculated immediately. Focusing the values field clears the example once while preserving the selected mode. Editing values or changing mode clears the confirmed result and disables copying until Calculate is used again. Clear empties the numeric list and retains the mode.
Calculation and result fields
For counts, each probability is its count divided by the total count. For probability mode, the page requires the supplied total to be within 0.000000001 of one and otherwise asks you to correct it. Shannon entropy in bits is H = −Σ pᵢ log₂(pᵢ). By definition, a zero-probability category contributes zero: the limit called 0 log 0 is treated as 0.
The contribution list connects each input position to its normalized probability and −p log₂p term. Adding those terms gives the main entropy. The maximum for k listed categories is log₂(k), achieved by a uniform distribution. Normalized entropy is H/log₂(k), useful as a 0–1 comparison for lists with different numbers of categories.
Worked examples
Counts 10, 20 and 30 normalize to probabilities 1/6, 1/3 and 1/2. Their contributions are about 0.43, 0.53 and 0.5 bits, for total entropy about 1.46 bits. The three-category maximum is log₂(3), about 1.58 bits, so normalized entropy is about 0.92.
Four equal counts 1, 1, 1, 1 give 2 bits, exactly log₂(4), and normalized entropy 1. Probabilities 0.5, 0.25 and 0.25 give 1.5 bits. The list 1, 1, 0 gives 1 bit: the zero entry remains visible and contributes zero.
Reading entropy responsibly
Higher entropy means the distribution is more even or less predictable when one category is drawn under this model. Lower entropy means more mass is concentrated in fewer categories. Entropy does not say which category is desirable, whether differences are statistically significant or why a pattern occurred.
Compare values only when category definitions and data collection are compatible. Adding unused zero categories raises the displayed theoretical maximum but not H, which changes normalized entropy. Decide the category set before using evenness for comparison.
Limits and data quality
Values must be ordinary nonnegative decimals; negative values, NaN, infinity and an all-zero count list are rejected. Counts may be fractional weights, although integer event counts are easier to explain. Very large values are limited to avoid unstable arithmetic. Displayed values are rounded while the sum uses full JavaScript numeric precision.
This is a distribution calculator, not a statistical estimator. It provides no bias correction, sampling interval, hypothesis test or uncertainty measure. Small observed samples can have downward-biased entropy. Missing or merged categories can change the answer substantially.
Common questions
Is the logarithm base selectable? No. The page uses base 2, so the unit is bits. Does one bit mean one binary password character? No. Distribution entropy here is not a guarantee of password strength, cryptographic randomness or text-source unpredictability.
Why must probabilities sum to one? They already claim to be a complete distribution. Use Counts if you want the page to normalize arbitrary nonnegative weights. Copy result includes the total, maximum, normalized entropy and each position’s contribution, but does not save or transmit the inputs.