← All Tools

ðŸŽŊ Bayes' Theorem Calculator

Update a prior belief (base rate) with new evidence and compute the posterior probability. Essential for interpreting medical tests, A/B experiments, spam filters, and any "I got a positive result — what does it actually mean?" situation.

Inputs

How common is the condition before any test?
%
How often the test correctly flags a positive case.
%
How often the test correctly rejects a negative case.
%

Classic scenarios

Results

P(H|E) — Positive predictive value
—
If the test is positive, what's the chance you actually have it?
P(®H|®E) — Negative predictive value
—
If the test is negative, what's the chance you're actually clear?
P(E) — Overall positive rate
—
Fraction of all tests that will come back positive.
Bayes factor (likelihood ratio +)
—
How many times more likely a positive result is if you have the condition.

Confusion matrix — 10,000 people

Has conditionNo conditionTotal
Test positive———
Test negative———
Total——10,000

Formula

P(H|E) = P(E|H) · P(H) / P(E)
P(E) = P(E|H) · P(H) + P(E|ŽH) · P(ŽH)
P(E|®H) = 1 − specificity (false positive rate)

When the base rate is small, even a very accurate test produces mostly false positives — because the pool of true negatives is so much larger than the pool of true positives. This is the base rate fallacy, and it's why screening rare conditions in a general population is surprisingly unreliable.