Bayes’ Theorem Calculator
Compute the posterior probability P(A|B) from the prior P(A), the evidence P(B), and the likelihood P(B|A).
Result
How to use this calculator
- Enter the prior probability P(A) — the base rate before evidence.
- Enter the likelihood P(B|A) — how likely the evidence is when A holds.
- Enter the overall evidence probability P(B).
- Read the posterior P(A|B), your updated probability after the evidence.
About this calculator
Bayes’ theorem updates a probability in light of new evidence. It combines three ingredients: the prior P(A), your belief that A is true before seeing the evidence; the likelihood P(B|A), how probable the evidence B is when A is true; and the overall probability of the evidence P(B). The posterior P(A|B) — your updated belief after seeing B — equals P(B|A) times P(A), divided by P(B). The classic illustration is medical testing: even a 90%-accurate test for a disease that affects only 1% of people yields a surprisingly low probability of actually having the disease given a positive result, because the rare base rate dominates. This calculator makes that base-rate effect explicit by showing the joint probability and the final posterior.
How it works — the formula
P(A|B) = P(B|A) · P(A) ÷ P(B)
(law of total probability: P(B) = P(B|A)P(A) + P(B|¬A)P(¬A))The posterior is the joint probability of A and B divided by the total probability of B, rescaling the prior by how consistent the evidence is with A.
Worked examples
- Inputs:
- pa=0.01, pba=0.9, pb=0.05
- Output:
- P(A|B) = 0.18 (18%)
- Inputs:
- pa=0.5, pba=0.8, pb=0.6
- Output:
- P(A|B) = 0.667
- Inputs:
- pa=0.3, pba=0.5, pb=0.4
- Output:
- P(A|B) = 0.375
Limitations
- Requires P(B) directly; compute it via total probability if you only have the false-positive rate.
- Garbage-in: an inaccurate prior or likelihood gives a misleading posterior.
- Assumes the three inputs are mutually consistent probabilities.
A mathematical update rule; the quality of the answer depends on the quality of the inputs.
Frequently asked
What is Bayes’ theorem?+
What is the difference between prior and posterior?+
Why is the result so low in the disease-test example?+
How do I find P(B) if I do not have it directly?+
What is the likelihood P(B|A)?+
Must all the inputs be between 0 and 1?+
Related calculators
More tools you might like
Hand-picked tools that pair well with this one — same audience, same intent.
Compute P(A and B), P(A or B), and P(A|B) for two events, whether they are independent or dependent.
Find the probability that at least two people in a group share a birthday — the famous, counterintuitive birthday problem.
z = (x − μ) / σ — how many standard deviations a value is above or below the mean.
Compute probability density and cumulative probability at x for given μ, σ.
Compute sample (n−1) and population (n) standard deviation from a list of numbers.
Generate a tidy "About the Author" PDF page — bio, photo placeholder, prior works list, contact / social links.