Bayes Theorem Calculator
Calculate posterior probability from a prior and two likelihoods, with step-by-step substitution, likelihood ratio, and a natural-frequency breakdown.
This works right here on your device — nothing gets sent out.
Math and statistics
Bayes Theorem Calculator
Inputs
Result
P(H | E) — posterior probability
P(¬H | E)
- P(¬H)
- P(E) — total probability of evidence
- Likelihood ratio P(E|H) / P(E|¬H)
How it works
- Pick an example (medical test, spam filter, drug test) or enter your own prior probability and two likelihoods.
- The prior probability P(H) is how likely the hypothesis is before you see any evidence.
- P(E|H) and P(E|¬H) are how likely the evidence is if the hypothesis is true or false.
- The calculator combines these into the posterior probability P(H|E), shows the step-by-step substitution, and translates the result into a natural-frequency example out of 1,000 cases.
The formula
Bayes' theorem combines the prior probability with the evidence's likelihood under both outcomes:
P(E) = P(E|H) x P(H) + P(E|¬H) x P(¬H)
P(H|E) = [P(E|H) x P(H)] / P(E)
FAQ
What does this Bayes theorem calculator find?
It calculates the posterior probability P(H|E) — how likely a hypothesis H is after seeing evidence E — from the prior probability P(H), the likelihood of the evidence if H is true P(E|H), and the likelihood of the evidence if H is false P(E|¬H).
Why is the result so much lower than the test's accuracy?
This is the base rate fallacy. Even a highly accurate test produces many false positives when the condition itself is rare, because the false positives from the much larger unaffected group can outnumber the true positives from the small affected group. The natural-frequency breakdown under the result shows this out of 1,000 cases.
What is the likelihood ratio?
It is P(E|H) divided by P(E|¬H) — how many times more likely the evidence is under the hypothesis than under its complement. A ratio far from 1 means the evidence is strongly diagnostic; a ratio near 1 means it barely moves your belief.
Can I enter values as decimals instead of percentages?
The inputs expect percentages (0–100). To use a decimal probability like 0.01, multiply it by 100 and enter 1.
Does this handle more than two competing hypotheses?
No — this calculator covers the standard two-outcome case (H and ¬H). For three or more competing hypotheses you would need a full naive Bayes calculation across each one.
How we compare
| Feature | Online Tool Store | OmniCalculator | GigaCalculator |
|---|---|---|---|
| Posterior probability from prior + two likelihoods | Yes | Yes | Yes |
| Step-by-step formula substitution | Yes | Not shown | Not shown |
| Natural-frequency explanation (out of 1,000) | Yes | Not shown | Not shown |
| Likelihood ratio | Yes | Not shown | Not shown |
| Ready-made real-world examples | Yes | One worked example | Four worked examples |
| Copy results and no account | Yes | Not shown | Not shown |
For understanding why a positive test result doesn't mean what most people assume, the natural-frequency breakdown alongside the exact posterior makes the base rate fallacy concrete instead of abstract.