Binary entropy calculator
Measure uncertainty for a two-outcome event from its probability.
inputs.
Related calculators
Use these tools when your question extends to a neighboring part of the same calculation.
How to use this calculator
Calculate binary Shannon entropy in bits from the probability of one of two outcomes.
- Enter Event probability p (0–1). Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Measure uncertainty in a two-outcome event
Binary entropy summarizes how uncertain a single event is when its probability is p and the alternative has probability 1 − p. It reaches zero for a certain outcome and one bit when both outcomes are equally likely.
Inputs and units
- Event probability p (0–1): Probability of the selected event; enter a value from 0 through 1, not a percentage such as 25.
Formula and method
H(p) = −p log₂(p) − (1−p)log₂(1−p). A term with probability zero is defined by its limit as zero, so H(0) = H(1) = 0. The logarithm base 2 reports bits.
Worked example
For p = 0.25, H = −0.25log₂(0.25) − 0.75log₂(0.75) = 0.5 + 0.311278 = 0.811278 bits, displayed as 0.8113.
Interpreting the result
The event carries about 0.811 bits of uncertainty before its outcome is known. This is an average over repeated trials with the same probability, not a forecast of which outcome one trial will produce.
Assumptions and limits
The model has exactly two mutually exclusive outcomes whose probabilities sum to one. It measures uncertainty in the stated distribution and does not measure the importance, fairness, or value of an outcome.
Method references
Frequently asked questions
Why is entropy highest at p = 0.5?
At equal probabilities neither outcome is favored, so the event is hardest to predict. A certain outcome has no uncertainty and therefore zero entropy.
How do I use the Binary entropy calculator?
Enter Event probability p (0–1). Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Binary entropy?
For p = 0.25, H = −0.25log₂(0.25) − 0.75log₂(0.75) = 0.5 + 0.311278 = 0.811278 bits, displayed as 0.8113.
What does the Binary entropy calculator calculate?
Calculate binary Shannon entropy in bits from the probability of one of two outcomes.
What assumptions apply to Binary entropy?
The model has exactly two mutually exclusive outcomes whose probabilities sum to one. It measures uncertainty in the stated distribution and does not measure the importance, fairness, or value of an outcome.