Bayes' Theorem Conditional Probability Calculator
Update your likelihood model in real time. Enter a prior, sensitivity, and false positive rate - and instantly see the posterior probability with a plain-English frequency translation.
Enter values above to see a plain-English translation.
Medical students frequently confuse these two terms when setting up Bayesian equations. They are not independent - they are two sides of the same coin.
| Metric | What it measures | Formula | Bayes input? |
|---|---|---|---|
| Sensitivity | How well the test catches real cases (true positive rate) | TP / (TP + FN) | P(B|A) - direct input |
| Specificity | How well the test clears innocent cases (true negative rate) | TN / (TN + FP) | Indirect - convert to FPR first |
| False Positive Rate | Fraction of healthy cases that test positive | 1 - Specificity | P(B|~A) - direct input |
| False Negative Rate | Fraction of real cases missed by the test | 1 - Sensitivity | Not used directly |
| Positive Predictive Value | Probability the condition is present given a positive test | TP / (TP + FP) | This IS the posterior P(A|B) |
The Complete Guide to Bayesian Probability
How to Use This Calculator
Start by selecting a scenario preset or choosing "Custom Model" to enter your own values. Use the format toggle to switch between percentage, decimal, and per-1000-frequency inputs - the calculator converts all three to decimals before running the math, so you will never get a percentage-squared error.
Move the sliders or type directly into the number fields. Results update with every keystroke. The Posterior Probability box shows the key output: the probability the condition is present given a positive result. The Natural Frequency Translator below it converts the abstract math into a concrete count across 10,000 hypothetical cases.
Understanding the Three Core Inputs
The Prior Probability P(A) is the prevalence of the condition in the population you are sampling from. This is often the most important number, and the one people most frequently forget. A disease that affects 1 in 10,000 people has a prior of 0.01%.
Sensitivity P(B|A) is the test's ability to detect real cases. A 90% sensitivity means it catches 9 out of 10 true positives. The remaining 1 in 10 is a false negative.
The False Positive Rate P(B|~A) is the probability the test fires incorrectly on a healthy sample. Even a 1% false positive rate can overwhelm a true positive signal when the condition is rare, because the pool of healthy people is so much larger than the pool of sick people.
The Bayes' Theorem Formula Step by Step
Step 1 - Standardize all inputs to decimals between 0 and 1. If you input 1.5%, the engine works with 0.015. This prevents the classic percentage-squared error.
Step 2 - Compute the probability of a positive test in the whole population. This is called P(B): P(B) = (Sensitivity x Prior) + (FPR x (1 - Prior)).
Step 3 - Compute the posterior: P(A|B) = (Sensitivity x Prior) / P(B). This is the probability the condition is truly present given the positive test. In most real-world screening scenarios this number is far lower than people expect.
Why This Matters: The Rare Disease Paradox
Suppose a disease affects 0.1% of the population. Your test has 99% sensitivity and a 5% false positive rate. Bayes' Theorem gives a posterior of about 1.9%. That means roughly 98% of positive results are false alarms, even with a test that feels highly accurate. This is not a flaw in the test - it is a mathematical consequence of the low base rate.
Public health screening programs, airport security screening, and drug testing all face this exact problem. A test that feels effective in isolation can generate enormous false-positive burdens when applied to low-prevalence populations at scale.
Spam Filtering and Machine Learning Applications
A Naive Bayes spam classifier assigns a prior probability to every incoming email (roughly 40-70% of all email is spam globally). It then updates that prior using the likelihoods of individual word frequencies derived from training data. The posterior probability for each email either exceeds a threshold (mark as spam) or does not (allow through). This exact Bayesian update cycle - prior, evidence, posterior - runs millions of times per day across every major email service.