Last updated October 13, 2026 · Report an error
Bayes' theorem answers a question that trips up even trained professionals: given a positive test result, what's the actual probability that the underlying condition is present? The answer often depends far more on how rare the condition is than on how accurate the test is.
This calculator finds the posterior probability given a prior probability, the likelihood (true positive rate), and the false positive rate, with a full step-by-step solution.
How it works
Enter the prior probability P(A) — how common the condition is before any testing — along with the likelihood P(B|A) — the probability of a positive result given the condition is present — and the false positive rate P(B|not A). The calculator finds the marginal probability of a positive result and then the posterior probability P(A|B) using Bayes' theorem.
- Enter p(A) — prior probability (%).
- Enter p(B|A) — likelihood (%).
- Enter p(B|not A) — false positive rate (%).
- Click Calculate to see your results.
Examples
The classic rare-disease test example
A disease affects 1% of the population. A test correctly identifies 99% of people who have the disease, but also falsely flags 5% of people who don't. Despite the test's high accuracy, a positive result only means about a 16.67% chance of actually having the disease — because the disease is so rare that false positives from the healthy 99% of the population outnumber true positives from the sick 1%.
Who should use it
- Interpreting a medical test result in context of how common the underlying condition actually is.
- Evaluating the reliability of a spam filter, fraud detector, or other classification system.
Industry applications
- Medical diagnostics and epidemiology
- Machine learning and statistical modeling
Advantages
- Corrects for the base rate fallacy that trips up even trained professionals.
- Includes a complete, formula-based step-by-step solution.
Limitations
- Requires knowing (or estimating) the prior probability accurately — a wrong prior produces a misleading posterior.
Common mistakes to avoid
- Confusing the test's accuracy (likelihood) with the actual probability of having the condition given a positive result (posterior) — these are very different numbers when the condition is rare.
- Ignoring the prior probability entirely and assuming a positive result means the condition is present with the test's stated accuracy.
Best practices
- Always factor in how common or rare the condition actually is (the prior) — a highly accurate test can still produce a low posterior probability for a rare condition.
Tips
- When in doubt about the exact prior probability, try the calculation with a plausible range of priors to see how sensitive the posterior probability is to that assumption.