Conditional Probability Calculator
From P(A), P(B) and P(B|A), find the conditional probability P(A|B), the intersection P(A ∩ B), the union P(A ∪ B) or P(A|not B), with a check that the inputs are consistent.
Last updated: September 2026
Probability
0.525
Formula below · 3 sources (ocw.mit.edu, openstax.org, mathworld.wolfram.com) · Updated Sep 2026
Compare with similar
About this calculator
Conditional probability is the probability of one event given that another has happened:
P(A|B) = P(A ∩ B) ÷ P(B).
From the three inputs: • Intersection (multiplication rule): P(A ∩ B) = P(A) × P(B|A). • A given B (Bayes' theorem): P(A|B) = P(A) × P(B|A) ÷ P(B). • Union (addition rule): P(A ∪ B) = P(A) + P(B) − P(A ∩ B). • A given not B: P(A|B′) = (P(A) − P(A ∩ B)) ÷ (1 − P(B)).
Enter probabilities as decimals between 0 and 1. Not every combination is possible: P(A ∩ B) cannot be larger than P(B), and the union cannot exceed 1; the calculator says so instead of returning an impossible probability. A and B are independent exactly when P(B|A) = P(B), in which case P(A|B) = P(A).
How to use
Example (the defaults): P(A) = 0.3, P(B) = 0.4, P(B|A) = 0.7. Intersection = 0.3 × 0.7 = 0.21. P(A|B) = 0.21 ÷ 0.4 = 0.525. Union = 0.3 + 0.4 − 0.21 = 0.49. P(A|not B) = (0.3 − 0.21) ÷ 0.6 = 0.15. Medical test: P(A) = 0.01 (prevalence), P(B|A) = 0.9 (sensitivity), P(B) = 0.108 (all positive results). P(A|B) = 0.009 ÷ 0.108 = 0.0833.
Frequently asked questions
What is the difference between P(A|B) and P(B|A) in conditional probability?
P(A|B) asks: given that B has already occurred, how likely is A? P(B|A) asks the reverse: given A has occurred, how likely is B? These two quantities are generally not equal and confusing them is called the 'inverse fallacy' or 'transpose fallacy.' Bayes' theorem is precisely the tool for converting one into the other: P(A|B) = P(B|A)·P(A)/P(B). In medical testing, P(positive|disease) is the test sensitivity, while P(disease|positive) is what the patient actually wants to know.
How does Bayes' theorem apply to real-world probability problems?
Bayes' theorem lets you update a prior belief P(A) with new evidence B to produce a posterior probability P(A|B). It is used in spam filters (updating the probability an email is spam given certain words), medical diagnosis (updating disease probability given a positive test), and machine learning classifiers. The key insight is that the posterior depends heavily on the prior — a rare disease remains unlikely even after a positive test if the base rate P(A) is very low, as demonstrated by the classic medical testing paradox.
When are two events considered independent in probability theory?
Two events A and B are independent when P(A ∩ B) = P(A) × P(B), which equivalently means P(A|B) = P(A) — knowing B occurred gives no information about A. Independence is a special case that simplifies calculations considerably. In practice, true independence is rare: coin flips and dice rolls are independent, but most real-world events (disease and symptoms, weather and accidents) are correlated. This calculator handles the general dependent case via P(A ∩ B) = P(A) × P(B|A), which reduces to P(A) × P(B) only when A and B are independent.
Related calculators
Sources & references
Think a result is wrong? Report a problem with this calculator.