Skip to content

Bayes' Theorem Calculator

Update a prior probability after observing B in a two-case model: A or not A.

PriorA—Not A—P(A∩B)—P(Aᶜ∩B)—All evidence B—Updated A—

Enter the prior and likelihoods

Processed in your browser.

Decimal from 0 to 1.

Chance of evidence B when A is true.

Chance of evidence B when A is not true.

Bayes result

Enter the prior and both likelihoods, then calculate.

How to use Bayes' theorem

Use this two-case form when A and not A cover all possibilities and you know how likely evidence B is in each case.

  1. Enter the prior P(A).
  2. Enter P(B|A), the likelihood of the evidence if A is true.
  3. Enter P(B|Aᶜ), the likelihood of the same evidence if A is false.
  4. Select Calculate to obtain P(B) and the posterior P(A|B).
  5. Review the assumptions behind the three inputs before using the number.

The two-case Bayes formula

The numerator is P(A)P(B|A). The evidence probability is P(B)=P(A)P(B|A)+(1−P(A))P(B|Aᶜ). Dividing the numerator by that evidence gives P(A|B).

Prior, likelihood, and posterior

The prior describes A before observing B. A likelihood describes how compatible B is with each case; it is not itself the posterior. The posterior is the updated share of the evidence attributable to A under this model.

Zero evidence and model limits

If both weighted likelihood branches are zero, P(B)=0 and the posterior is undefined. More importantly, the result is only as useful as the chosen two-case model and input probabilities. It does not verify data quality or causal assumptions.

Responsible interpretation

  • Use the same evidence event B in both likelihood fields.
  • Make sure A and not A are complementary cases.
  • Do not treat a likelihood as the probability that A is true.
  • For health, legal, financial, or safety decisions, use qualified professional evidence and guidance.

Worked example

Suppose P(A)=0.10, P(B|A)=0.80, and P(B|Aᶜ)=0.20. Then P(B)=0.26 and P(A|B)=0.08/0.26≈0.3077, or 30.77%.

Frequently asked questions

What is P(B|Aᶜ)?

It is the chance of observing B when A is not true. In a test example it may resemble a false-positive rate, but the calculator is not a diagnostic tool.

Why include P(B)?

It normalizes both ways that evidence B can occur so the posterior stays within 0 and 1.

Can the posterior be lower than the prior?

Yes. Evidence that is relatively more likely when A is false decreases the probability of A.

Why is zero evidence rejected?

Bayes’ ratio would divide by P(B)=0, so no numeric posterior is defined.