Skip to content
RK Calculator
Menu

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).

About p(a)Probability of event A: 0.3, 3/10 or 30%.
About p(b)Probability of event B.
About p(b | a)Probability of B when A has happened.
Result
P(A | B)
0.18
As a percentage
18%

P(A | B) = 0.18.

Show the working
  1. 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).

About p(a)Probability of event A: 0.3, 3/10 or 30%.
About p(b)Probability of event B.
About p(a | b)Probability of A when B has happened.
Result
P(B | A)
0.375
As a percentage
37.5%

P(B | A) = 0.375.

Show the working
  1. 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).

About p(b)Probability of event B.
About p(a | b)Probability of A when B has happened.
About p(b | a)Probability of B when A has happened.
Result
P(A)
0.25
As a percentage
25%

P(A) = 0.25.

Show the working
  1. 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).

About p(a)Probability of event A: 0.3, 3/10 or 30%.
About p(a | b)Probability of A when B has happened.
About p(b | a)Probability of B when A has happened.
Result
P(B)
0.3
As a percentage
30%

P(B) = 0.3.

Show the working
  1. 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%).

Formula version 0.1.0Reviewed