Bayes’ Theorem Calculator
Update a prior probability with new evidence. Enter the base rate of a condition and how often the evidence appears with and without it, and see the posterior probability, worked steps and a natural-frequency table.
Updated · By Bibin XavierData 90 × 12
| IDtext · 90 levels | Grouptext · 3 levels | Gendertext · 2 levels | Agenumeric | Hours_Studynumeric | Anxietynumeric | Motivationnumeric | Pre_Scorenumeric | Post_Scorenumeric | Exam_Scorenumeric | Passednumeric · coded | Satisfactionnumeric · coded |
|---|---|---|---|---|---|---|---|---|---|---|---|
| S001 | Control | Male | 23 | 11.2 | 29 | 4.6 | 60 | 62 | 67 | 1 | 2 |
| S002 | Workshop | Female | 23 | 3.9 | 28 | 3.5 | 54 | 70 | 54 | 0 | 2 |
| S003 | Online | Female | 18 | 10.1 | 32 | 4 | 55 | 57 | 66 | 0 | 3 |
| S004 | Control | Male | 26 | 13.6 | 41 | 3.5 | 52 | 55 | 59 | 0 | 3 |
| S005 | Workshop | Female | 22 | 9.7 | 27 | 3.6 | 56 | 63 | 65 | 0 | 4 |
| S006 | Online | Female | 20 | 7.9 | 32 | 3.8 | 65 | 82 | 65 | 0 | 2 |
| S007 | Control | Female | 20 | 6.3 | 28 | 3 | 72 | 83 | 61 | 0 | 3 |
| S008 | Workshop | Male | 22 | 8 | 29 | 3.1 | 64 | 72 | 62 | 1 | 3 |
Variables and options
Results
Calculated in your browserResult
| Quantity | Value |
|---|---|
| P(B) = P(B|A)P(A) + P(B|¬A)P(¬A) | 0.0882 |
| P(A | B), posterior after positive evidence | 0.1020 (10.20%) |
| P(A | ¬B), posterior after negative evidence | 0.0011 (0.11%) |
| Likelihood ratio P(B|A) / P(B|¬A) | 11.250 |
| Prior odds → posterior odds | 0.0101 → 0.1136 |
Note. Bayes’ theorem: P(A|B) = P(B|A) P(A) / P(B). Posterior odds = likelihood ratio × prior odds.
Natural frequencies (out of 10,000)
| Evidence B present | Evidence B absent | Total | |
|---|---|---|---|
| A true | 90 | 10 | 100 |
| A false | 792 | 9,108 | 9,900 |
| Total | 882 | 9,118 | 10,000 |
Note. Of the 882 cases with the evidence, 90 actually have A: 90 / 882 = 10.2%.
Prior vs posterior probability of A
Interpretation
Starting from a prior of 1.00%, positive evidence raises the probability of A to 10.2%. Even with accurate evidence, a low base rate means most positive results are false positives.
How to cite this tool
Using these results in a thesis, journal article, report or class assignment? Please cite this free tool so others can find it. It keeps the site free.
APA 7
Xavier, B. (2026). Bayes’ Theorem Calculator [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/bayes-theorem-calculator/
BibTeX
@software{xavier_bayestheoremcalculator_2026,
author = {Xavier, Bibin},
title = {Bayes’ Theorem Calculator},
publisher = {FreeStatisticalTools.com},
year = {2026},
url = {https://freestatisticaltools.com/bayes-theorem-calculator/},
note = {Web application}
}Suggested sentence for your methods section: “The analysis was carried out with the free Bayes’ Theorem Calculator tool on FreeStatisticalTools.com (Xavier, 2026).”
What is Bayes’ theorem?
Bayes’ theorem updates the probability of a hypothesis A after observing evidence B: P(A|B) = P(B|A) P(A) / P(B). It explains why a positive result from an accurate test can still be more likely a false alarm when the condition is rare. The calculator shows the posterior, the likelihood ratio and a natural-frequency table.
When to use Bayes’ theorem
Use it for diagnostic tests (probability of disease after a positive test), spam filters, forensic evidence, or any question of how much new evidence should change a belief.
How to set up your data
Three probabilities between 0 and 1: the prior (base rate), the probability of the evidence when A is true, and when A is false. Specificity = 1 − false positive rate.
How to use this calculator
- Enter the values. Fill in prior probability p(a) (base rate), p(b | a): evidence when a is true (sensitivity), p(b | not a): evidence when a is false (false positive rate) and population for natural frequencies.
- Read the results. Results update automatically. Read the plain-English interpretation, then use Copy table to paste APA-style tables into Word and Copy for the results sentence.
How to report Bayes’ theorem in APA style
“With a prevalence of 1%, sensitivity of 90% and a false positive rate of 8%, the probability of disease after a positive test is 10.2%.”
Frequently asked questions
What is the formula for Bayes’ theorem?
P(A|B) = P(B|A) × P(A) / P(B), where P(B) = P(B|A)P(A) + P(B|¬A)P(¬A).
What is the positive predictive value?
In diagnostic testing, P(disease | positive test) is the positive predictive value. It depends strongly on prevalence, not only on sensitivity and specificity.
How do I use specificity instead of the false positive rate?
The false positive rate is 1 − specificity. A test with 92% specificity has a false positive rate of 0.08.
What are natural frequencies?
Counts in an imagined population, such as “90 of the 100 people with the condition test positive”, which make Bayesian reasoning easier to follow.
Related tools
Browse all categories
Data cleaning and preparation · Describe and explore · Compare means · Nonparametric tests · Correlation and regression · Bayesian statistics · Categorical data · Reliability and agreement · Multivariate analysis · Structural equation modeling · Econometrics and time series · Panel data and causal inference · Marketing and decision research · Survival, clinical and meta-analysis · Study planning and calculators · PLS-SEM