Skip to content
D DocNectar

Free Bayes' Theorem Calculator

Calculate the posterior probability of an event using Bayes' theorem, given a prior probability and test accuracy.

100% Free No Signup Works on all devices

Last updated October 13, 2026 · Report an error

Thanks for rating!

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.

  1. Enter p(A) — prior probability (%).
  2. Enter p(B|A) — likelihood (%).
  3. Enter p(B|not A) — false positive rate (%).
  4. 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.

Frequently asked questions

Yes, with no signup and no limit on how many calculations you run.
When a condition is rare, even a small false positive rate applied to the much larger healthy population can produce more false positives than true positives from the small affected population — this is the base rate fallacy, and it's exactly what Bayes' theorem corrects for.
The marginal probability P(B) is the overall probability of a positive test result across the entire population, combining true positives from people with the condition and false positives from people without it.
Yes — Bayes' theorem applies to any scenario with a prior probability and a test or signal with a known true/false positive rate, from spam filtering to fraud detection.

Get new calculators and guides in your inbox

No spam — just new tools like Bayes' Theorem Calculator and practical guides.

Favorites