Statistics

Bayes' Theorem Calculator

Enter the prior probability P(A), the likelihood P(B | A) of observing B when A is true, and the likelihood P(B | A') of observing B when A is false. The calculator applies the law of total probability for P(B) and Bayes' theorem for the posterior P(A | B).

Bayes' Theorem Calculator

Compute the posterior P(A | B) from a prior P(A) and two likelihoods.

Try:

Frequently asked questions

What is Bayes' theorem?

A formula for reversing conditional probabilities: P(A | B) = P(B | A)·P(A) / P(B). It is how you update a belief about A after observing B.

Why is the medical-test example counterintuitive?

Even with a very accurate test (P(+ | disease) = 0.99), a low base rate (P(disease) = 0.01) keeps the posterior P(disease | +) low — about 17%. Most positives still come from the much larger healthy population.

What is the prior?

P(A) — the probability you assign to A before seeing the evidence B. Bayes' theorem updates it to the posterior P(A | B).