Easy CalculatorsOnline
A little less guesswork.

Statistics · EVERYDAY CLARITY

Bayes’ theorem calculator

Update a prior from likelihoods in two complementary groups.

Units & number format

Number formatting changes the display; the interface and guides are in English. Dates use calendar controls; numeric lists use decimal points and comma or space separators.

01 · CALCULATE

Work out your numbers

Your inputs stay in this browser.

Example result · using the values shown

Posterior P(A given B)
66.666667%
Probability (0–1)0.6666666667
See visual ↓

Two exhaustive groups A and notA. Positive total evidence probability is required.

02 · SEE THE RESULT

Your numbers, pictured

Example visualization

Event and complement

Event0.666667 probability66.7%
Complement0.333333 probability33.3%

Share of the total

Event0.666667 probability
Complement0.333333 probability
0 probabilityShared scale0.666667 probability

The posterior conditions on B and includes both possible sources of that evidence.

03 · UNDERSTAND THE METHOD

How the bayes’ theorem calculator works

Bayes’ theorem updates a prior probability using how likely the observed evidence is in two complementary groups. This calculator models A and not A as exhaustive alternatives, then calculates the share of evidence B that originates from A. It is useful for learning how base rates and likelihoods interact. The inputs are hypothetical or user supplied; the tool does not determine the quality or applicability of the underlying evidence model.

The formula and its variables

P(A|B)=P(A)P(B|A)/[P(A)P(B|A)+(1−P(A))P(B|not A)]
Prior
Probability of A before conditioning on B.
Likelihoods
Probabilities of B in A and its complement.

The calculation, step by step

  1. Enter the prior probability of A, the likelihood of B given A, and the likelihood of B given not A. Use the same definition of evidence in both groups.
  2. Multiply the prior by its likelihood and the complementary prior by the other likelihood. Add these two joint contributions to obtain total evidence probability.
  3. Divide the A contribution by total evidence. Require the total to be positive and read the updated conditional probability.

A worked example

A prior of 0.2, likelihood 0.8 in group A, and likelihood 0.1 outside A produce evidence contributions 0.16 and 0.08. Total evidence probability is 0.24. The posterior share is 0.16/0.24=2/3, approximately 66.666667%. Ignoring the second group would incorrectly treat all observed evidence as coming from A.

Example inputs and calculated output
Prior P(A)0.2
P(B given A)0.8
P(B given not A)0.1
Posterior P(A given B)66.666667%

How to read the result and visual

The posterior depends on both likelihoods and the prior. Evidence common outside A may provide less support than a large first likelihood alone suggests. The result is a conditional model output, not a statement of causation. A posterior can legitimately remain low when a prior is small, even if evidence is more likely within A.

Assumptions, rounding, and limitations

The two groups must be complementary and exhaustive. Zero total evidence is rejected because the requested condition is impossible under the entered model. This tool does not estimate likelihoods, quantify uncertainty in them, or make a medical, legal, or financial classification. Such applications need domain-appropriate data beyond arithmetic.

Frequently asked questions

Is P(B|A) the same as the posterior?

No. The posterior reverses the condition and must account for the prior and evidence from the other group.

Can Bayes’ theorem create reliable inputs?

No. It combines the probabilities you supply; their reliability must be assessed separately.

Reference sources

How we check calculations and what verification covers