Bayes Theorem Calculator

Calculate posterior and evidence probabilities from a prior and two conditional likelihoods.

Bayesian probability update
Enter each probability as a percentage from 0 to 100.

About Bayes theorem

Bayes theorem updates the probability of a hypothesis after observing evidence. The starting belief is the prior probability P(A). The likelihood P(B|A) describes how often the evidence would occur when the hypothesis is true. The alternative likelihood P(B|not A) describes how often the same evidence would occur when the hypothesis is false. Combining these quantities produces the posterior probability P(A|B), the revised probability of the hypothesis given the observed evidence. The denominator is the total probability of the evidence. For two exhaustive possibilities, A and not A, it equals P(B|A) times P(A), plus P(B|not A) times P(not A). This weighted average matters because evidence can occur under either explanation. Dividing the joint probability of A and B by the total evidence probability normalizes the result. The posterior always lies from zero to one when the inputs are valid probabilities and the evidence has a nonzero chance of occurring. Medical testing provides a familiar example. Even a sensitive test can yield a modest posterior probability when the condition is rare and false positives occur. With a one percent prevalence, 99 percent sensitivity, and five percent false-positive rate, a positive result corresponds to a posterior of about 16.67 percent. The low prior means false positives among the much larger healthy population outnumber many true positives. Bayes theorem makes that base-rate effect explicit rather than treating test accuracy as the probability that a positive result is correct. The same reasoning supports fraud detection, quality control, forecasting, diagnostics, spam filtering, and scientific inference. Inputs must refer to the same event definitions and population. A prior should be established before using the current evidence, while likelihood estimates should come from representative conditional data. Correlated evidence should not be multiplied as though observations were independent. The calculated posterior is only as credible as its assumptions and estimates, so sensitivity analysis across plausible inputs is often useful. This calculator uses the complete binary form of Bayes theorem, automatically calculates evidence, and displays percentages for readability. It is designed for transparent probability updates, examples, and quick checks rather than replacing a full Bayesian model with multiple hypotheses or continuous parameters.

Bayes theorem examples

Prior; likelihood; alternative likelihoodPosteriorInterpretation
1%; 99%; 5%16.6667%Rare-condition medical screening
50%; 80%; 20%80.0000%Evidence strongly favors A from equal prior odds
20%; 60%; 10%60.0000%Evidence triples the prior probability

How to use Bayes theorem

  1. Estimate the prior probability that hypothesis A is true before observing B.
  2. Enter the probability of observing B when A is true.
  3. Enter the probability of observing B when A is false.
  4. Select Calculate Posterior and interpret the updated probability together with the evidence probability.

Frequently asked questions

What is a prior probability?

A prior is the probability assigned to a hypothesis before considering the current evidence. It may come from prevalence, historical data, or a defensible initial model.

What is posterior probability?

The posterior is the updated probability of the hypothesis after accounting for the observed evidence. It can become the prior for a later update when new evidence arrives.

Is likelihood the same as posterior probability?

No, likelihood describes evidence assuming the hypothesis, while posterior probability describes the hypothesis given evidence. Reversing these conditional probabilities is a common error.

Why include P(B|not A)?

The evidence may also occur when A is false, and that alternative route contributes to the denominator. Ignoring it usually exaggerates how strongly B supports A.

Can Bayes theorem handle more than two hypotheses?

Yes, the evidence denominator can sum likelihood times prior across all mutually exclusive hypotheses. This calculator focuses on the common binary case of A versus not A.