Share this free calculator
Send this tool to someone who needs the calculation.
How to use
Bayes’ theorem starts with a prior probability and updates it after observing evidence. Enter P(A), the likelihood of the evidence when A is true, and the likelihood when A is false. The calculator returns the posterior and the denominator components so the base-rate effect is visible.
- Enter prior P(A) as a percentage.
- Enter P(B|A).
- Enter P(B|not A).
- Read posterior P(A|B) and total evidence probability.
How it is calculated
Example
Educational example: type A makes up 10% of boxes. Evidence B appears in 80% of A boxes and 20% of non-A boxes. After seeing B, P(A|B)≈30.77%, not 80%.
Important notes
Bayes’ theorem does not validate the inputs. The result is only as sound as the prior and likelihood estimates. This is a general educational calculator, not a medical diagnostic or legal decision tool.
Worked examples and interpreting results
If prior P(A)=10%, P(B|A)=80% and P(B|not A)=20%, total P(B)=26% and P(A|B) is about 30.769%.
| Case | Calculation | Result |
|---|---|---|
| Total probability of B | (0.1 × 0.8 + 0.9 × 0.2) × 100 | 26 % |
| Probability of A given B | 0.1 × 0.8 ÷ 0.26 × 100 | 30.769231 % |
How to check the result
Enter percentages from 0 to 100. Do not swap P(B|A) with P(A|B); the result needs the prior and the likelihood of B under both cases.
Frequently asked questions
P(B|A) versus P(A|B)?
The first is the chance of evidence given the event; the second is the event probability after observing the evidence.
What is the base rate?
It is prior P(A) before seeing the evidence.
What if P(B)=0?
The posterior is undefined because the denominator is zero.
Can I enter percentages?
Yes. The calculator converts them internally to probabilities from 0 to 1.