Conditional Probability Calculator

Compute P(A|B) from joint and marginal probability

How it is calculated

Enter the joint probability P(A ∩ B), the chance that A and B both happen, and the probability P(B) of the condition. The tool divides: P(A|B) = P(A ∩ B) / P(B). Both inputs are probabilities between 0 and 1, not percentages, and the answer is also a decimal between 0 and 1 rounded to two places.

There is no result if P(B) is zero or above 1, if the joint probability is negative or above 1, or if the joint probability is larger than P(B). The last case is impossible because both events cannot happen together more often than B alone. Only the definition is applied: the tool does not test whether A and B are independent and does not use Bayes' rule.

Worked example

Suppose 30% of orders are express (P(B) = 0.3) and 12% of all orders are both express and delivered late (P(A ∩ B) = 0.12). The chance an express order is late is 0.12 / 0.3 = 0.40, or 40%. Compare that with the 12% you would get by wrongly reading the joint figure as the conditional one.

Try this example →

Common mistakes

  • Typing percentages. 12 and 30 give no result because the tool needs 0.12 and 0.3.
  • Entering P(A) in place of the joint probability P(A ∩ B). The numerator must be the chance of both happening together.
  • Entering a joint probability bigger than P(B). That is logically impossible and the tool returns nothing, so check which event is the condition.
  • Reading P(A|B) as P(B|A). They are generally different: the chance that a late order was express is not the chance that an express order is late.
  • Multiplying instead of dividing, as if A and B were independent. Here P(A ∩ B) is the given figure, not something computed from P(A) × P(B).

About this calculator

This calculator applies the definition of conditional probability, P(A|B) = P(A ∩ B) / P(B): given the probability that both A and B happen together, and the probability that B happens at all, it tells you the probability of A specifically among the cases where B is already known to be true. The result is only defined when P(B) is greater than zero.

Statisticians and data analysts use this constantly — in medical testing (probability a patient has a disease given a positive test), spam filtering (probability an email is spam given it contains a certain word), and A/B testing (probability of conversion given a user saw a particular variant) — anywhere new information should update a probability estimate rather than leave it at its unconditional value.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Once you have P(A|B), compare it with P(A) on its own. If the two are equal, B tells you nothing about A and the events are independent; if the conditional value is higher or lower, B shifts the odds. If you only have counts, divide each by the total first: 12 cases of both out of 100 and 30 of B give 0.12 and 0.3, so 0.40. What are A and B in your situation?

Popular calculators

All Calculators