Bayes’ theorem shows why a positive result on an accurate test can still mean a modest probability when the condition is rare.
How to use the Bayes’ Theorem Calculator
- Prior probability P(A)
- P(B | A) — e.g. sensitivity
- P(B | not A) — e.g. false-positive rate
Results update as you type, and every field accepts the units shown in its menu.
How it works
Multiply the prior by the likelihood and divide by the total probability of the evidence.
Inputs explained
| Field | What to enter |
|---|---|
| Prior probability P(A) | In % |
| P(B | A) — e.g. sensitivity | In % |
| P(B | not A) — e.g. false-positive rate | In % |
What each result means
- Posterior P(A | B) = [P(B | A) — e.g. sensitivity]×[Prior probability P(A)]÷([P(B | A) — e.g. sensitivity]×[Prior probability P(A)] + [P(B | not A) — e.g. false-positive rate]×(100 – [Prior probability P(A)]))×100
- Total P(B) = ([P(B | A) — e.g. sensitivity]×[Prior probability P(A)] + [P(B | not A) — e.g. false-positive rate]×(100 – [Prior probability P(A)]))÷100
Example values
How the main result changes when Prior probability P(A) changes and everything else stays at the example values above:
| Prior probability P(A) (%) | Posterior P(A | B) (%) |
|---|---|
| 0.5 | 8.716 |
| 0.75 | 12.555 |
| 1 | 16.102 |
| 1.25 | 19.388 |
| 1.5 | 22.441 |
| 2 | 27.941 |
Formula
P(A|B) = P(B|A) P(A) ÷ [P(B|A) P(A) + P(B|¬A) (1 − P(A))]Worked example
Inputs — Prior probability P(A): 1 %; P(B | A) — e.g. sensitivity: 95 %; P(B | not A) — e.g. false-positive rate: 5 %.
Results — Posterior P(A | B) = 16.102 %; Total P(B) = 5.9 %.
Frequently asked questions
Why is the answer only about 16%?
With 1% prevalence, false positives from the 99% without the condition outnumber true positives.
What is a prior?
Your probability before seeing the new evidence.
What formula does the Bayes’ Theorem Calculator use?
P(A|B) = P(B|A) P(A) ÷ [P(B|A) P(A) + P(B|¬A) (1 − P(A))].