Bayes Theorem Calculator
Calculate posterior probability from prior, likelihood, and evidence using Bayes' theorem.
About Bayes Theorem Calculator
Bayes' theorem calculates the probability of a hypothesis given observed evidence: P(H|E) = P(E|H) × P(H) / P(E). It is the foundation of Bayesian inference, spam filters, medical diagnosis models, and any system that updates beliefs based on new data.
Formula
Bayes' Theorem
P(H|E) = P(E|H) * P(H) / P(E)
- P(H)
- Prior probability of hypothesis
- P(E|H)
- Likelihood of evidence given hypothesis
- P(E)
- Total probability of evidence
Worked example
With the default values below, Bayes Theorem Calculator returns Posterior P(H|E) of 0.180000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Prior P(H)accepts 0–1
- 0.01
- Likelihood P(E|H)accepts 0–1
- 0.9
- Evidence P(E)accepts 0–1
- 0.05
Results
- Posterior P(H|E)
- 0.180000
Step by step
- 1Numerator: P(E|H) × P(H)= 0.009000
- 2Posterior: numerator ÷ P(E)= 0.180000
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is the difference between prior and posterior?
The prior is your initial belief about a hypothesis before seeing evidence. The posterior is the updated belief after incorporating the evidence through Bayes' theorem.
How is Bayes' theorem used in ML?
It underpins Naive Bayes classifiers, Bayesian neural networks, Bayesian optimization for hyperparameter tuning, and probabilistic programming frameworks like PyMC and Stan.
Related Calculators
You might also need
- Posterior Probability CalculatorCommonly used together
- Naive Bayes Probability CalculatorCommonly used together
- Prior Probability CalculatorCommonly used together
- Likelihood CalculatorCommonly used together
- Probability Tree CalculatorCommonly used together
- Conditional Probability CalculatorCommonly used together
