Skip to content

Conditional Probability Calculator

Given how often A and B occur together, and how often B occurs at all, find the probability of A once you already know B happened.

What this answers

Conditional probability answers "given that B has already happened, what is the probability that A also happened?" This is a narrower question than the plain probability of A, since conditioning on B restricts attention to only the cases where B is true.

How it is calculated

The formula is P(A|B) = P(A and B) divided by P(B): the fraction of B's cases that also satisfy A. Because you are dividing by P(B), this calculator states the conditioning event explicitly, and the result is undefined whenever P(B) is exactly zero, since conditioning on an impossible event has no meaningful probability to report.

Worked example

Suppose 40% of cases satisfy B, and 20% of all cases satisfy both A and B. Then P(A|B) = .2 / .4 = .5: among the cases where B is true, exactly half also have A true, even though A's overall (unconditional) probability might be quite different from 50%.

Assumption audit

Calculated from your data: P(A|B) directly from your two entered probabilities.
Evidence to review: whether your P(A and B) value is genuinely consistent with your P(B) value; the intersection can never exceed the conditioning event's own probability.
You must verify: that the conditioning event B in your data actually matches the B you intend to condition on; a common data-analysis error is conditioning on the wrong subgroup by accident.

Common mistakes

A common mistake is confusing P(A|B) with P(B|A); these are generally different quantities, and swapping them without proper adjustment (which requires Bayes Theorem) is one of the most persistent errors in applied probability. Another is treating a small P(B) as automatically making P(A|B) unreliable; the formula itself is exact regardless of how small P(B) is, as long as it is not exactly zero. A third is entering a P(A and B) value that exceeds P(B), which is an impossible combination since A and B together cannot occur more often than B occurs alone.

Limitations

This calculator takes P(A and B) and P(B) as given inputs; it does not verify that they were estimated consistently from the same underlying data or sample space.