Bayes Rule Calculator
Use this calculator to find the posterior probability P(H|E): the probability of a hypothesis given new evidence.
What is Bayes rule?
Bayes rule is a way to update beliefs when new evidence appears. You start with a prior belief about a hypothesis, combine it with how strongly the evidence supports that hypothesis, and end with an updated belief called the posterior probability.
In plain language: Bayes rule helps answer, “Now that I have this new information, how likely is my original assumption?”
When this calculator is useful
- Medical testing (What is the chance a patient actually has a disease after a positive test?)
- Fraud detection (How likely is a transaction fraudulent after a warning signal?)
- Spam filtering (How likely is an email spam given certain words?)
- Reliability and diagnostics (How likely is a component failure given sensor data?)
How to use the calculator
1) Enter prior probability, P(H)
This is your baseline chance before seeing the evidence. For rare events, this can be very small (for example 1% or 0.01).
2) Enter likelihood, P(E|H)
This is how often the evidence appears when the hypothesis is true. In testing language, this often corresponds to sensitivity.
3) Enter false positive rate, P(E|¬H)
This is how often the same evidence appears even when the hypothesis is false. If this is high, a positive signal can be misleading.
4) Click calculate
The calculator returns the posterior probability, plus useful intermediate values such as P(E) and the complement P(¬H|E).
Worked example
Suppose:
- Disease prevalence, P(H) = 1%
- Test sensitivity, P(E|H) = 95%
- False positive rate, P(E|¬H) = 5%
Even with a strong test, the posterior probability after a positive result is not 95%. It is much lower because the disease is rare. That is exactly why Bayes rule matters: base rates (priors) can dominate interpretation.
Common mistakes Bayes rule prevents
- Ignoring base rates: treating a high sensitivity as if it were the final probability.
- Confusing conditionals: mixing up P(E|H) and P(H|E).
- Overreacting to single signals: not accounting for false positives.
- Binary thinking: forgetting probabilities update gradually, not all-or-nothing.
Interpreting your output
The posterior probability is a rational update from prior to evidence-informed belief. A low posterior does not always mean “ignore the signal”; it means your current evidence is not yet strong enough to support high confidence. Add new independent evidence to update again.
Quick notes
- You can enter values as decimals (
0.2) or percentages (20%). - If you enter a number between 1 and 100 (without %), it is treated as a percent.
- All valid probabilities must be between 0 and 1 (or 0% and 100%).