Bayes Theorem Calculator
P(A|B) = [P(B|A) × P(A)] / [P(B|A) × P(A) + P(B|¬A) × (1 - P(A))]
Enter values as decimals (0 to 1) or percentages (0 to 100). Example: 0.01 or 1 for 1%.
What Is Bayes’ Formula?
Bayes’ formula (also called Bayes’ theorem) is a method for updating probability after seeing new evidence. It helps you answer questions like: “Now that I observed B, what is the chance that A is true?”
In plain language, Bayes combines:
- Your starting belief (the prior),
- How likely the evidence is when A is true (likelihood), and
- How often that evidence appears when A is false.
Inputs Used in This Bayes Formula Calculator
1) Prior probability: P(A)
This is your base rate before observing new evidence. Example: if 1 out of 100 people has a condition, then P(A) = 0.01.
2) Likelihood: P(B|A)
This means the probability of observing evidence B when A is true. In medical testing, this is similar to test sensitivity.
3) False positive rate: P(B|¬A)
This is the probability of observing B even when A is not true. In testing language, this is one minus specificity.
How to Interpret the Result
The calculator outputs P(A|B), also called the posterior probability. This is your updated probability that A is true after seeing B.
- High posterior means evidence strongly supports A.
- Low posterior means evidence may look convincing, but base rates and false positives reduce certainty.
- It also reports P(¬A|B) and P(B) for additional context.
Worked Example (Why Base Rates Matter)
Suppose:
- P(A) = 1% (condition prevalence),
- P(B|A) = 99% (high sensitivity),
- P(B|¬A) = 5% (false positives still happen).
Many people assume a positive result means “about 99% chance” of having the condition. Bayes shows this is not true. With a low base rate, false positives can outnumber true positives. The posterior can be much lower than intuition suggests.
Common Mistakes When Using Bayes Theorem
- Confusing P(A|B) with P(B|A).
- Ignoring the prior probability (base-rate fallacy).
- Using percentages and decimals inconsistently.
- Forgetting that even accurate tests can produce many false positives when events are rare.
Where Bayes Formula Is Useful
Medical diagnostics
Estimate disease probability after test results.
Spam filtering and machine learning
Classify messages or observations based on evidence.
Risk analysis and decision making
Update beliefs as new data arrives in finance, operations, or policy analysis.
Quick Usage Tips
- Start with realistic priors from data, not guesses.
- Use sensitivity and false positive rates from reliable studies.
- Run multiple scenarios to see how assumptions change outcomes.
- Communicate final probabilities with plain-language interpretation.
This Bayes formula calculator is designed for fast, practical conditional probability analysis. If you are teaching, learning, or making real-world decisions, it is a simple way to avoid common probability errors and reason more clearly.