Bayes' Theorem Calculator
Update a prior probability after observing B in a two-case model: A or not A.
Bayes result
Enter the prior and both likelihoods, then calculate.
- Evidence probability — P(B)
- —
- A and B — P(A∩B)
- —
- Not A and B — P(Aᶜ∩B)
- —
- Posterior of not A — P(Aᶜ|B)
- —
This is a probability calculator, not a medical diagnosis or decision tool.
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.
- Enter the prior P(A).
- Enter P(B|A), the likelihood of the evidence if A is true.
- Enter P(B|Aᶜ), the likelihood of the same evidence if A is false.
- Select Calculate to obtain P(B) and the posterior P(A|B).
- 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.