Conditional Probability Calculator: supported calculation
Calculate P(A given B) from two marginal probabilities and their intersection, checking consistency of the supplied probabilities. Enter P(A), P(B) and P(A ∩ B) as decimals from 0 to 1, with at most 12 decimal places. P(B) must be positive.
Enter the inputs
Fill the three labeled probability fields, then choose Calculate. Use a decimal such as 0.25 for 25%, not 25 or 25%. The example button replaces your inputs with the worked case below.
Worked example
A bag contains 10 tokens: five red, four marked with a star and two both red and starred. Let A mean red and B mean starred. Enter 0.5, 0.4 and 0.2. Then P(A given B) = 0.2/0.4 = 0.5, or 50%. The union probability is 0.7.
Formula and assumptions
Conditional probability is P(A ∩ B)/P(B). The union is P(A) + P(B) − P(A ∩ B). The intersection must be no larger than either marginal and at least max(0, P(A) + P(B) − 1). These checks reject impossible combinations without assuming independence.
Unsupported cases and common mistakes
P(A given B) usually differs from P(B given A). Conditioning on an event with probability zero is undefined in this finite-probability workflow. The tool does not infer the intersection from the marginals; multiplying them would require an independence assumption.
Limits and result precision
Decimal input is converted to fixed-point integers with 12 fractional places, so consistency checks and intermediate products do not depend on a floating-point tolerance. Final ratios are shown to 12 significant digits and may be rounded. This display precision does not make estimated input probabilities more accurate.
Editing any field clears the previous result. Calculate again after a change; Copy results includes the displayed labels and answers.
Use Bayes Rule Calculator to derive a posterior from a prior and two likelihoods instead of a supplied intersection.





