Apply Bayes' theorem to update a prior probability from sensitivity and false positive inputs, then review posterior probability, negative-result probability.
Last updated
Update a prior belief with new evidence Use Bayes' theorem to convert a prior probability, sensitivity, and false positive rate into a posterior probability, evidence rate, odds update, and natural-frequency breakdown.
Scenario presets
Rare condition with a fairly accurate positive test.
Input format
Assumptions
Keep the prior, sensitivity, and false positive rate aligned to the same population and evidence event. Specificity is derived as 1 minus the false positive rate, and the negative-result update uses the matching false negative rate.
Posterior probability
15.38%
The posterior probability is 15.38%, which is higher than the prior 1.00%. Out of every 10,000 similar cases, about 90 positive results would be true positives and 495 would be false positives.
Posterior P(A|B)
0.15
After negative P(A|not B)
0
Evidence rate P(B)
5.85%
LR+ / Bayes factor
18
LR-
0.11
Posterior lift vs prior
15.38
Odds view
Prior odds of 0.01 become posterior odds of 0.18 after applying the likelihood ratio.
Base-rate view
A prior of 1% means the complement prior is 99%. Sensitivity is 90%, specificity is 95%, and rare events can still produce many false positives if the unaffected group is much larger.
Positive vs negative evidence
Evidence result
Posterior probability
Evidence rate
Likelihood ratio
Positive / evidence observed
15.38%
5.85%
18
Negative / evidence absent
0.11%
94.15%
0.11
A negative result would leave a posterior probability of 0.11%, which is lower than the same prior. Out of every 10,000 similar cases, about 10 negative results would be false negatives and 9405 would be true negatives.
Natural frequency sheet
Among 10,000 similar cases, this is the expected split between true positives, false positives, true negatives, and false negatives.
True positives
90
False positives
495
True negatives
9,405
False negatives
10
Total positive results
585
Total negative results
9,415
How to read the update Bayes' theorem does not say whether the evidence is “good” or “bad” on its own. It shows how strongly the evidence should move your prior belief after accounting for the base rate and the false positive path.
Bayes' theorem calculator: posterior probability, base rates, sensitivity, specificity
A Bayes' theorem calculator helps you update an initial belief after new evidence appears. Instead of stopping at a raw formula, this page shows the posterior probability, the evidence rate, LR+ and LR−, odds updates, sensitivity and specificity context, positive and negative result interpretation, and a natural-frequency view that makes base-rate effects much easier to understand.
What Bayes' theorem is doing
Bayes' theorem relates the posterior probability P(A|B) to the prior P(A), the likelihood P(B|A), and the total probability of the evidence P(B). In plain language, it answers the question: once I have seen this evidence, how should I revise what I believed before?
That matters because people often confuse sensitivity, hit rate, or test accuracy with the final probability of the hypothesis. Bayes' theorem shows that the answer also depends on the base rate. If the prior probability is very small, even fairly strong evidence can still produce a posterior that is much lower than intuition expects.
This calculator therefore keeps the formula view, odds view, positive-versus-negative evidence view, and natural-frequency view visible. The formula gives the exact posterior, while the frequency view shows how many true positives, false positives, true negatives, and false negatives you would expect in a large sample with the same assumptions.
P(A|B) = P(B|A) × P(A) / P(B)
Bayes' theorem: the posterior probability of A given evidence B.
P(B) = P(B|A) × P(A) + P(B|¬A) × P(¬A)
The total probability of the evidence, using the law of total probability.
P(A|¬B) = P(¬B|A) × P(A) / P(¬B)
The matching update after a negative or absent evidence result.
Percent inputs, decimal inputs, and the same Bayes formula
Many Bayes theorem calculator pages ask for percentages because medical-test and classifier examples are commonly written as prevalence, sensitivity, and specificity percentages. Textbooks often write the same values as decimals between 0 and 1. This calculator supports both formats so you can enter the values in the form you have.
The formula does not change when you switch formats. A 1% prior is the same as 0.01, 90% sensitivity is the same as 0.90, and 5% false positive rate is the same as 0.05. The important part is to avoid mixing formats in the same run.
Worked example: a positive test for a rare condition
Suppose a condition has 1% prevalence, a positive test catches 90% of true cases, and the false positive rate is 5%. Bayes' theorem gives a posterior probability of about 15.38% after one positive test. That is far below 90%, not because the test is useless, but because the condition starts out rare.
A natural-frequency rewrite makes the same result easier to read. Out of 10,000 similar cases, roughly 100 would truly have the condition. With 90% sensitivity, about 90 of them would test positive. But among the 9,900 unaffected cases, a 5% false positive rate still creates about 495 positive results. That means only 90 of the 585 positive tests are true positives, which again gives a posterior of about 15.38%.
This is why Bayes' theorem is so useful in diagnostics, fraud detection, spam filtering, legal evidence puzzles, risk scoring, quality control, and classification systems. It prevents you from reading an impressive likelihood in isolation and ignoring the much larger pool of unaffected cases that can still generate false alarms.
The natural-frequency version of the posterior after a positive result.
Sensitivity, specificity, LR+, and LR−
Sensitivity is P(B|A): the probability that the evidence appears when the hypothesis is true. In diagnostic language, it is the true-positive rate. Specificity is P(¬B|¬A): the probability that the evidence is absent when the hypothesis is false. The false positive rate is 1 minus specificity.
The positive likelihood ratio, LR+, equals sensitivity divided by the false positive rate. It tells you how many times more likely a positive result is under the hypothesis than under the alternative. The negative likelihood ratio, LR−, equals the false negative rate divided by specificity. It tells you how strongly a negative result should reduce the probability.
Competitor calculators often show only the positive posterior. This page also shows the negative-result posterior, so you can see both paths from the same sensitivity and specificity assumptions.
LR+ = Sensitivity / False positive rate
Bayes factor for a positive or observed-evidence result.
LR− = False negative rate / Specificity
Likelihood ratio for a negative or absent-evidence result.
Likelihood ratios, odds, and base-rate interpretation
The likelihood ratio measures how strongly the evidence favours the hypothesis compared with the alternative. A ratio above 1 supports the hypothesis, below 1 weakens it, and exactly 1 means the evidence is not informative because it is equally likely under both paths.
Posterior odds equal prior odds multiplied by the likelihood ratio. That odds form is useful because it makes sequential updating easier to understand: each new piece of evidence multiplies the current odds rather than replacing them from scratch.
Even so, a strong likelihood ratio does not eliminate the need for a realistic prior. If the prior is tiny, the posterior can still remain modest. That is the main lesson behind many Bayes theorem calculator examples: the evidence matters, but the starting prevalence matters too.
Posterior odds = Prior odds × Likelihood ratio
The odds form of Bayes' theorem, often easier to use for repeated updates.
Posterior probability = Posterior odds / (1 + Posterior odds)
Converts odds back into probability after applying the evidence ratio.
Choosing the natural-frequency cohort size
The calculator lets you change the natural-frequency cohort size. A 10,000-case scale is useful for rare-event examples because it keeps small prior probabilities visible as whole-number counts. A 1,000-case scale can be easier for classroom or presentation examples when the prior is not extremely small.
Changing the cohort size does not change the posterior probability. It changes only the count-based explanation. The same assumptions should produce the same posterior whether you explain them as percentages, decimals, or expected counts.
When this calculator is useful and what it does not cover
This calculator is useful when you already know or want to test a prior probability, a true-positive path, and a false-positive path for the same evidence event. Common examples include screening tests, fraud alerts, spam filters, quality-control flags, legal evidence puzzles, and basic machine-learning classification explanations.
It does not estimate the prior for you, and it does not build a full Bayesian model with multiple competing hypotheses, repeated observations, or dependent evidence. It is a focused calculator for the standard two-path Bayes theorem setup.
If the prior, likelihood, and false positive rate are pulled from different populations or inconsistent studies, the posterior will look precise while still being misleading. The tool is best used when all three inputs describe the same population and evidence definition.
Frequently asked questions
What does a Bayes' theorem calculator calculate?
It calculates a posterior probability from a prior probability, the likelihood of the evidence when the hypothesis is true, and the likelihood of the same evidence when the hypothesis is false. This page also reports evidence probability, likelihood ratios, odds updates, and natural-frequency counts.
Why is the posterior often much lower than the test sensitivity?
When the prior probability is low, the unaffected group is much larger than the affected group. Even a modest false positive rate can therefore generate many positive results from unaffected cases. Sensitivity tells you how well the evidence catches true cases, but it does not tell you how many false alarms appear alongside them. Bayes' theorem combines both effects, which is why the posterior can be far below the sensitivity value.
What is the difference between sensitivity and specificity?
Sensitivity is the true-positive rate: P(positive evidence | hypothesis true). Specificity is the true-negative rate: P(negative evidence | hypothesis false). The false positive rate used in the calculator is 1 minus specificity.
What is LR+ in Bayes' theorem?
LR+ is the positive likelihood ratio, calculated as sensitivity divided by the false positive rate. It is also a Bayes factor for positive evidence in this two-path setup.
What is LR− in Bayes' theorem?
LR− is the negative likelihood ratio, calculated as the false negative rate divided by specificity. It shows how much a negative result should reduce the probability of the hypothesis.
What happens when P(B|A) equals P(B|¬A)?
The likelihood ratio becomes 1, so the posterior equals the prior. The evidence is just as likely whether the hypothesis is true or false, which means it adds no information. In practical terms, the evidence event does not help you separate true cases from non-cases.
Why do natural frequencies make Bayes' theorem easier to understand?
Many people find counts more intuitive than abstract probabilities. Saying that about 90 out of 10,000 cases are true positives and about 495 are false positives makes it easier to see why a positive result is not as conclusive as the test sensitivity suggests. The same posterior result is present in both views, but natural frequencies make the base-rate effect visible instead of hidden inside the formula.
Does a high likelihood ratio guarantee a high posterior probability?
No. A high likelihood ratio means the evidence is much more compatible with the hypothesis than with the alternative, but the final posterior still depends on the prior probability. If the prior is extremely small, the posterior can remain moderate even after a large update. That is why Bayes' theorem always needs both the prior and the evidence terms.
Can I enter percentages instead of decimals?
Yes. Use the input-format control to choose percent or decimal inputs. The math is the same as long as all three probability fields use the same format.
Can I use this as a medical test calculator?
You can use it for educational diagnostic-test examples when you know the prevalence, sensitivity, and false positive rate or specificity. It is not a clinical decision tool and does not replace medical judgment, local screening guidance, or validated risk models.
Can I apply Bayes' theorem repeatedly?
Yes, if the evidence updates are appropriate and conditionally independent under the model. The posterior from one update can become the prior for the next update. Correlated evidence should not be treated as independent just because it arrives in separate steps.