Update a probability with new evidence. Enter how likely A is to begin with, how likely the evidence B is when A is true and when it is false, and see the posterior probability P(A|B), worked step by step with a probability tree and a table of natural frequencies.
Last updated:
%
How common A is before seeing the evidence (base rate)
%
e.g. test sensitivity / true positive rate
%
e.g. false positive rate (100% − specificity)
Enter your values to see the result.
Advertisement
Advertisement
How to use the Bayes Theorem Calculator
Name the events (optional): A is the hypothesis, B the evidence you observed.
Enter P(A), the base rate before the evidence, as a percentage.
Enter P(B | A) and P(B | not A), how often the evidence appears when A is true and when it is false.
Read P(A | B), the updated probability, and follow the tree and the frequency table.
Try a preset to see how a low base rate changes the answer.
In odds form: posterior odds = prior odds × likelihood ratio, with odds = p ÷ (1 − p) and likelihood ratio = P(B|A) ÷ P(B|¬A). This form is handy for updating several times with independent pieces of evidence.
How the base rate changes the answer
Same test (90% sensitivity, 9% false positive rate, likelihood ratio 10), different base rates:
Prior P(A)
P(B)
Posterior P(A|B)
0.1%
9.08%
0.99%
1%
9.81%
9.17%
5%
13.05%
34.48%
10%
17.10%
52.63%
30%
33.30%
81.08%
50%
49.50%
90.91%
The rarer A is, the more of the positive results come from the large group where A is false. Thinking in natural frequencies (“out of 10,000 people…”) makes this easy to see.
Frequently asked questions
What is Bayes' theorem?
Bayes' theorem gives the probability of A after observing B: P(A|B) = P(B|A) × P(A) ÷ P(B). The denominator comes from the law of total probability: P(B) = P(B|A)P(A) + P(B|not A)P(not A).
Why is P(A|B) so low for a positive result on an accurate test?
Because the condition is rare. With a 1% base rate, 90% sensitivity and a 9% false positive rate, 10,000 people produce 90 true positives but 891 false positives, so only 90 ÷ 981 ≈ 9.2% of positives actually have the condition. Ignoring the base rate is called the base rate fallacy.
What is the difference between P(A|B) and P(B|A)?
They answer different questions. P(B|A) is how often the evidence appears when A is true (for a test, its sensitivity). P(A|B) is how likely A is once you have seen the evidence. Confusing the two is a common error.
What is the likelihood ratio?
LR = P(B|A) ÷ P(B|not A). Bayes' theorem in odds form says posterior odds = prior odds × LR. An LR of 10 multiplies the odds of A by 10; an LR of 1 means the evidence tells you nothing.
How do sensitivity and specificity fit in?
For a diagnostic or screening test, P(B|A) is the sensitivity and P(B|not A) is 1 − specificity (the false positive rate). P(A|B) is then the positive predictive value and 1 − P(A|not B) the negative predictive value.
Can I enter probabilities as decimals?
Enter them as percentages: 0.5 means 0.5%, so type 50 for a probability of 0.5. The steps show the same numbers as decimals.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.