Bayes' Theorem Calculator
Use Bayes' theorem to find P(A | B), P(B | A), P(A) or P(B) from the other three probabilities.
Change the values and press Calculate to work out your own figures.
Find P(A | B)
Enter P(A), P(B) and P(B | A).
Show the working
- P(A | B) = P(B | A) × P(A) ÷ P(B) = 0.9 × 0.01 ÷ 0.05 = 0.18
Find P(B | A)
Enter P(A), P(B) and P(A | B).
Show the working
- P(B | A) = P(A | B) × P(B) ÷ P(A) = 0.5 × 0.3 ÷ 0.4 = 0.375
Find P(A)
Enter P(B), P(A | B) and P(B | A).
Show the working
- P(A) = P(A | B) × P(B) ÷ P(B | A) = 0.4 × 0.5 ÷ 0.8 = 0.25
Find P(B)
Enter P(A), P(A | B) and P(B | A).
Show the working
- P(B) = P(B | A) × P(A) ÷ P(A | B) = 0.6 × 0.4 ÷ 0.8 = 0.3
How to use it
Enter P(A), P(B) and P(B | A). Enter P(A), P(B) and P(A | B). Enter P(B), P(A | B) and P(B | A). Enter P(A), P(A | B) and P(B | A).
Probabilities can be typed as decimals, fractions or percentages. Show the working gives the formula with your numbers in it.
Key facts
P(A | B) = P(B | A) P(A) ÷ P(B)
Why base rates matter
A test that is 90% sensitive for a condition that affects 1% of people still produces mostly false positives when positives are rare: with P(positive) = 5%, P(condition | positive) is only 18%.
Questions
What is Bayes' theorem?
P(A | B) = P(B | A) × P(A) ÷ P(B).
Why is P(A | B) not P(B | A)?
They answer different questions; Bayes' theorem converts one into the other.
Formulas
P(A | B) = P(B | A) P(A) ÷ P(B)
Sources
Limitations
- Probabilities can be typed as decimals (0.25), fractions (1/4) or percentages (25%).