Bayesian Inference Calculator
Calculate posterior probability, Bayes factor, likelihood ratio, and evidence strength using Bayes' theorem.
About this calculator
This calculator applies Bayes' theorem, P(H|E) = P(E|H) × P(H) / P(E), to update a starting belief about a hypothesis (Prior Probability, P(H)) once new evidence arrives. Likelihood P(E|H) is how probable that evidence would be if the hypothesis were true, and Evidence Probability P(E) is the overall probability of observing that evidence across every possible state of the world. Posterior Probability P(H|E) is the updated belief in the hypothesis after accounting for the evidence -- it rises with a stronger Prior Probability or Likelihood, and falls as Evidence Probability rises, because evidence that would have been likely regardless of the hypothesis is weaker support for it.
Because the three inputs describe the same probability space, they aren't fully independent: the joint probability of the hypothesis and evidence both being true, P(E|H) × P(H), can never exceed the overall Evidence Probability -- an event can't be less probable than one of its own sub-cases. This calculator enforces that constraint by treating Evidence Probability as at least the joint probability, which keeps Posterior Probability from exceeding 100% even if you enter an Evidence Probability that's inconsistent with your Prior and Likelihood. Bayes Factor compares the odds of the hypothesis after and before the evidence (Posterior Odds ÷ Prior Odds); a value above 1 means the evidence favored the hypothesis, and it rises with Likelihood and falls as Evidence Probability rises, for the same reason Posterior Probability does.
Inputs
Results
Posterior Probability P(H|E)
66.67%
Bayes Factor
2
How to Use This Calculator
- Enter the prior probability P(H) for your hypothesis.
- Input the likelihood P(E|H): probability of the evidence given the hypothesis is true.
- Enter the evidence probability P(E), the overall probability of observing the evidence.
- Review the posterior probability P(H|E), calculated automatically using Bayes' theorem.
- Check the Bayes factor, likelihood ratio, prior odds, and posterior odds for additional measures of how strongly the evidence supports the hypothesis.
How the result changes with Evidence Probability P(E)
| Evidence Probability P(E) | Posterior Probability P(H|E) | Bayes Factor |
|---|---|---|
| 0.45 | 88.89% | 8 |
| 0.9 | 44.44% | 0.8 |
| 1 | 40% | 0.667 |
What each input means
- Prior Probability P(H)
- Prior probability of hypothesis
- Likelihood P(E|H)
- Probability of evidence given hypothesis
- Evidence Probability P(E)
- Marginal probability of evidence
How this is calculated
Formula
P(H|E) = P(E|H) × P(H) / P(E)Worked example, using the default values
- Identify Input Parameters3 parametersPrior Probability P(H) = 0.5, Likelihood P(E|H) = 0.8, Evidence Probability P(E) = 0.6 = 3 input(s) provided
- Calculate Posterior Probability PPosterior Probability = (Likelihood × Prior Probability) / Evidence Probability66.67 = 66.67%
- Calculate Bayes FactorBayes Factor = Likelihood Ratio = P(E|H) / P(E|¬H)2 = 2
- Calculate Likelihood RatioLikelihood Ratio = P(E|H) / P(E|¬H)2 = 2
- Calculate Prior OddsPrior Odds = Prior Probability / (1 − Prior Probability)1 = 1
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why can't I get a Posterior Probability above 100%?
A probability can never exceed 100% by definition, and Bayes' theorem enforces that automatically as long as the three inputs describe a consistent probability model. Specifically, Evidence Probability P(E) can never be smaller than the joint probability of the hypothesis and evidence both occurring (Likelihood × Prior Probability) -- that joint event is a subset of the evidence occurring at all. If you enter an Evidence Probability below that joint value, this calculator treats it as at least the joint probability so the result stays a valid probability rather than an impossible number above 100%.
Why does raising Evidence Probability lower my Posterior Probability?
Evidence Probability P(E) is how likely you'd see that evidence under ANY circumstance, not just when the hypothesis is true. If the evidence would have been common regardless of whether the hypothesis holds, observing it tells you comparatively little -- so a higher Evidence Probability weakens how much the evidence should shift your belief, which is exactly what dividing by a larger P(E) does to the posterior. That relationship only kicks in once Evidence Probability rises above the joint probability of the hypothesis and evidence both occurring (Likelihood × Prior Probability): below or exactly at that joint value, this calculator holds Evidence Probability at the joint itself (see "Why can't I get a Posterior Probability above 100%?"), so every raw Evidence Probability you enter in that lower range produces the identical Posterior Probability -- a flat plateau at the maximum-possible value, not a smoothly changing one -- until your entered value actually exceeds the joint.
What does a Bayes Factor greater than 1 actually mean?
Bayes Factor is the ratio of your Posterior Odds to your Prior Odds -- how much the evidence multiplied your confidence in the hypothesis. A Bayes Factor above 1 means the evidence favored the hypothesis (your odds improved); a value below 1 means the evidence actually weakened the case for the hypothesis, even if the hypothesis still remains more likely than not overall.
How is Bayes Factor different from Likelihood Ratio?
For this two-hypothesis setup (H vs. ¬H), Bayes Factor and Likelihood Ratio are the same number: both equal P(E|H) ÷ P(E|¬H), the ratio of how probable the evidence is under the hypothesis versus under its complement. Bayes Factor is conceptually framed as the overall change in odds (Posterior Odds ÷ Prior Odds), while Likelihood Ratio isolates just the evidence's own diagnostic strength -- but by Bayes' theorem applied to both H and ¬H, those two framings algebraically reduce to the identical value, which is why this calculator computes Bayes Factor directly from Likelihood Ratio rather than re-deriving it through the odds ratio (a redundant path that broke down with a division-by-zero at Prior Probability's own 0% and 100% boundary values).
Can the Prior Probability alone tell me whether to trust a result?
No -- Prior Probability only represents your belief before seeing the evidence. A high Posterior Probability can come from a moderate prior combined with strong evidence (a high Likelihood relative to Evidence Probability), just as a low posterior can result from weak evidence even with a favorable prior. Look at Posterior Probability and Bayes Factor together to judge both where you ended up and how much the evidence itself actually moved the needle.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Probability Calculator
Calculate probability of single events, combined events (AND/OR), permutations, and combinations.
Machine Learning & AIModel Performance Metrics Calculator
Calculate accuracy, precision, recall, F1 score, MCC, AUC, and other classification performance metrics.
StatisticsBayesian Prior Calculator
Apply Bayes' theorem to update a prior probability given test sensitivity and false positive rate. Calculate the posterior probability after a positive or negative result.
MLOps & AI CostingInference Latency Calculator
Estimate model inference latency, throughput, and memory requirements across CPU, GPU, and edge hardware.
Machine Learning & AINeural Network Parameters Calculator
Calculate total parameters, weights, biases, and memory requirements for neural network architectures.
More in Technology & Computing.