Conditional Probability Calculator

Conditional probability is the chance of A once you know B has happened. It shrinks the sample space to the cases where B is true.

Between 0 and 1.
Adds P(B | A) and an independence check.
Results update as you type.

P(A | B)

0.4

40%: the chance of A once B has happened

P(B | A)
0.3P(A and B) ÷ P(A)
P(A or B)
0.58
Independent?
YesP(A) × P(B) = 0.12

About this calculator

Add P(A) to also get the reverse probability P(B | A) and to test whether the events are independent.

How to use it

  1. Enter P(A and B) and P(B) as decimals.
  2. Optionally enter P(A).
  3. Read P(A | B).

The formula

P(A | B) = P(A and B) ÷ P(B)
P(A and B)
probability both happen
P(B)
probability of the given event

Worked example

P(A and B) = 0.12, P(B) = 0.3, P(A) = 0.4

  1. P(A | B) = 0.12 ÷ 0.3 = 0.4.
  2. P(A) × P(B) = 0.12 = P(A and B), so A and B are independent.

What the result means

P(A | B) and P(B | A) are usually different. Confusing them is a common error, for example with medical tests.

Assumptions

  • Probabilities between 0 and 1, with P(B) above 0.

Limitations

  • For updating a probability with test results, the Bayes calculator lays out the steps.

Frequently asked questions

What does the vertical bar mean?

“Given”. P(A | B) is the probability of A given B.

How do I know if events are independent?

If P(A and B) = P(A) × P(B), or equivalently P(A | B) = P(A).

Can I use percentages?

Enter them as decimals: 30% is 0.3.

Last reviewed on 6 October 2026. Found a mistake? Tell us.