Conditional Probability Calculator

Calculate P(A|B) and P(B|A) from joint, marginal, or conditional inputs — with contingency tables, independence tests, and lift analysis.

Joint probability
P(A | B)
0.416667
P(A∩B)/P(B) = 0.2500/0.6000
P(B | A)
0.833333
P(A∩B)/P(A) = 0.2500/0.3000
P(A ∩ B)
0.250000
Joint probability
P(A ∪ B)
0.650000
P(A) + P(B) − P(A∩B)
Independent?
No
P(A∩B) = 0.2500 ≠ 0.1800
Lift (A given B)
1.389×
B increases A's probability

All Conditional Probabilities

ConditionProbabilityPercentageVisual
P(A | B)0.41666741.67%
P(B | A)0.83333383.33%
P(A | ¬B)0.12500012.50%
P(B | ¬A)0.50000050.00%
P(¬A | B)0.58333358.33%
P(¬B | A)0.16666716.67%

Contingency Table (per 1,000)

B¬BTotal
A25050300
¬A350350700
Total6004001,000
Planning notes, formulas, and examples

About the Conditional Probability Calculator

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?".

When This Page Helps

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.

How to Use the Inputs

  1. Select an input mode based on what information you have available.
  2. Enter P(A) and P(B) — the marginal (unconditional) probabilities of each event.
  3. Enter the joint probability P(A∩B), or a conditional probability P(B|A) or P(A|B).
  4. Read P(A|B) and P(B|A) from the output — both conditional probabilities.
  5. Check whether events A and B are independent (P(A∩B) = P(A)×P(B)).
  6. Review the contingency table and all conditional probabilities for a complete picture.
Formula used
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).

Example Calculation

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.

Tips & Best Practices

  • P(A|B) ≠ P(B|A) in general — these are different questions. Confusing them is called the "prosecutor's fallacy."
  • If P(A|B) = P(A), then A and B are independent — knowing B tells you nothing about A.
  • Lift > 1 means B increases the probability of A; lift < 1 means B decreases it.
  • The contingency table is the most intuitive way to understand conditional probability — work with counts, not formulas.
  • When P(A∩B) > P(A)×P(B), the events are positively associated (co-occur more than chance would predict).
  • Use Bayes' theorem to flip conditionals: P(A|B) = P(B|A)×P(A)/P(B).

Conditioning Changes The Denominator

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.

Independence Is A Special Case

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.

Contingency Tables Make The Meaning Clear

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?"

Sources & Methodology

Last updated:

Frequently Asked Questions

  • 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.