Calculate P(A|B) and P(B|A) from joint, marginal, or conditional inputs — with contingency tables, independence tests, and lift analysis.
The conditional probability calculator computes P(A|B), the probability that A occurs once B is already known to have occurred. It also reverses the relationship to show P(B|A), which is often the number people actually want once the conditioning is made explicit.
You can start from a joint probability, from one conditional probability plus the marginals, or from counts in a contingency table. The calculator then fills in the rest of the relationship, including union probability, independence checks, and a scaled count table for intuition.
That makes it useful whenever the question is not "how likely is A?" but "how likely is A after we already know something about B?".
Conditional probability is easy to misread because the wording changes the sample space. This calculator keeps the notation and the interpretation together, which is helpful when you are working from counts, a joint probability, or a known conditional value.
It is especially useful for screening tests, market segmentation, reliability analysis, and any other situation where one event is evaluated inside the subset defined by another event.
P(A|B) = P(A ∩ B) / P(B). P(B|A) = P(A ∩ B) / P(A). Independence: P(A∩B) = P(A) × P(B). Lift = P(A|B) / P(A).
Result: P(A|B) = 0.4167, P(B|A) = 0.8333
P(A|B) = 0.25/0.6 ≈ 0.417, meaning if B has occurred, A's probability rises from 30% to 41.7%. P(B|A) = 0.25/0.3 ≈ 0.833, meaning if A has occurred, B is very likely.
When you compute P(A|B), B becomes the reference set. The formula P(A|B) = P(A∩B) / P(B) is just a ratio of the overlapping part to the full B set.
If A and B are independent, then P(A|B) = P(A). In that case, knowing B does not change the chance of A. The calculator highlights this because independence is often assumed when it should be tested.
Working in counts rather than decimals helps avoid confusion. A 1,000-person table makes it obvious how the same joint data can answer both "given B, how often A?" and "given A, how often B?"
Last updated:
P(A|B) means the probability of A within the subset where B is true. You're restricting your sample space to only outcomes where B has occurred, then asking how often A also occurs.
They answer different questions. P(rain|cloudy) asks about rain when it's cloudy. P(cloudy|rain) asks about clouds when it's raining. These can be very different numbers.
Check whether P(A∩B) = P(A) × P(B). Equivalently, check if P(A|B) = P(A). If either holds, the events are independent; knowing one gives no information about the other.
Confusing P(evidence|innocent) with P(innocent|evidence). A DNA match probability of 1 in a million doesn't mean there's a 1 in a million chance the suspect is innocent.
No. P(A|B) is always between 0 and 1. If your calculation yields a value outside this range, check that P(A∩B) ≤ min(P(A), P(B)).
Lift measures how much B changes A's probability: Lift = P(A|B)/P(A). A lift of 2 means A is twice as likely when B is present. It's widely used in marketing and recommendation systems.