P ProbLab
Tools/Bayes' Theorem Calculator

Bayes' Theorem Calculator

Start with a prior probability and update it with one or more independent pieces of evidence. Includes medical-test and spam-filter presets with sensitivity / false-positive rate inputs.

Setup

Advertisement

Posterior trajectory

Sequential update table

After test #P(H|E)LRPosterior odds

Why this exists

Almost no popular explanation of "Bayes' theorem" answers the actual question most people have: if I have a positive test result, what's the chance I actually have the disease? The answer depends on the prior (how common the disease is) and the test's false-positive rate, not just its sensitivity.

Classic example: 1% disease, 95% sens, 90% spec

Of 10,000 people, 100 have the disease. Test catches 95 of them. Of 9,900 healthy, 10% = 990 false-positive. Total positives: 1,085. Only 95 are true positives. So P(disease | positive) = 95/1085 ≈ 8.76%. Counter-intuitive, but real.

Who uses it

  • Doctors and epidemiologists interpreting screening results.
  • Data scientists calibrating classifiers.
  • Anyone arguing with a friend about base rates.

Limitations

  • Assumes test results are conditionally independent given H. In reality, repeat tests of the same kind often aren't independent (same lab, same systematic bias).
  • Uses fixed sensitivity / specificity. Real tests vary by patient subgroup.
  • Not a substitute for professional medical or statistical advice.

Frequently asked questions

How do I use Bayes' Theorem Calculator step by step without mistakes?
Follow the order given in the usage section: Update a prior with multiple pieces of evidence. Includes medical-test preset (sensitivity/specificity), spam-filter preset, and prior/posterior visualization. The step-by-step part matters less than the unit check that sits inside it. Confirm every unit matches the thing you are actually trying to measure before you press calculate - that single check catches more wrong answers than any other habit, and it costs about ten seconds.
What are the common mistakes when using Bayes' Theorem Calculator?
Most common mistakes come down to four habits: entering 20 when the field expects 0.2 because the field is a percentage; leaving a field blank and accepting the default without checking what it stands for; changing one input and reading a result that was calculated before the change; and quoting the output as an exact figure when the page describes it as a reference estimate. Press calculate again after any edit, and treat the number as a reference point rather than a final answer.
How do I read the result from Bayes' Theorem Calculator?
Read the final figure first, then come back to this section for the conditions behind it: Update a prior with multiple pieces of evidence. Includes medical-test preset (sensitivity/specificity), spam-filter preset, and prior/posterior visualization. Keep two things apart: the number itself, which comes from the values you typed, and the assumptions it depends on, which decide whether that number is meaningful. The page sets out what a higher or lower result means for your case, so check that direction as well as the magnitude.
Can I act on the Bayes' Theorem Calculator result directly?
Treat it as one reference sheet before you decide, rather than as the answer itself: Assumes test results are conditionally independent given H. In reality, repeat tests of the same kind often aren't independent (same lab, same systematic bias). Uses fixed sensitivity / specificity. Real tests vary by patient subgroup. Not a substitute for pro The output describes a magnitude under the conditions you entered. It does not include what it actually costs to act, what might change while you act, or how the other side behaves. Before you commit, compare the result against reality and note which assumptions do not hold where you are.
What inputs does Bayes' Theorem Calculator need?
Bayes' Theorem Calculator takes 5 inputs: Preset、Prior P(H)、P(E|H) — sensitivity (true positive rate)、P(E|¬H) — false positive rate (1 − specificity)、Number of independent positive tests. They are listed in the order they feed the calculation, so an earlier value can change a later one. Do not skip a field you do not recognise - work out what it means first, because a silently guessed value produces a number that looks reasonable and is not. Before typing anything, make sure every figure uses the same unit and the same time period.
What should I check before I run Bayes' Theorem Calculator?
Three checks pay for themselves. First, confirm the question you need answered is really inside the scope of this tool rather than a neighbouring one. Second, confirm that the figures you have are drawn from the same source and the same period - mixing monthly and annual numbers, or two different definitions of the same quantity, quietly distorts the result. Third, keep the key inputs written down, so that later you can tell which set of numbers produced a figure you are about to quote.