Introduction
This Conditional Probability Calculator finds the chance that one event happens when you already know another event happened. In math, we write that as P(A | B), and we say it out loud as "the probability of A given B."
The main formula is simple: P(A | B) = P(A ∩ B) ÷ P(B). You divide the chance that both events happen by the chance that B happens. The calculator runs that division and shows each step.
There are four ways to use it:
- Probabilities: enter P(A ∩ B) and P(B) as decimals.
- Counts: enter raw numbers, like 35 out of 50.
- 2×2 Table: enter four cell counts and get six conditional probabilities at once.
- Independence: check if two events affect each other or not.
Each tab gives you a decimal answer, a percent, the complement, a chart, and a step-by-step solution. Press Example on any tab to load a real-world problem and see how it works.
How to use our Conditional Probability Calculator
Pick a tab, type in your numbers, and press Calculate. The tool gives you P(A | B), the complement, a Venn diagram or chart, and a step-by-step solution you can follow.
Probabilities tab
P(A ∩ B) — Joint Probability: Type the chance that A and B both happen in the same trial. Use a decimal from 0 to 1, like 0.21.
P(B) — Marginal Probability: Type the chance that B happens on its own. It must be more than 0 and at least as big as P(A ∩ B).
Counts tab
count(A ∩ B): Type how many times A and B both happened. Use a whole number, 0 or more.
count(B): Type how many times B happened in total. This is your group size, not the whole sample. It must be more than 0 and at least as big as count(A ∩ B).
2×2 Table tab
Cell a: Type how many times A and B both happened. Whole numbers only.
Cell b: Type how many times B happened but A did not.
Cell c: Type how many times A happened but B did not.
Cell d: Type how many times neither A nor B happened. The row, column, and grand totals fill in as you type.
Independence tab
P(A): Type the chance that A happens on its own, as a decimal from 0 to 1.
P(B): Type the chance that B happens on its own. It must be more than 0.
P(A ∩ B): Type the chance that A and B happen together. It cannot be bigger than P(A) or P(B). The tool then tells you if the two events are independent or dependent.
Press Example on any tab to load a real-world scenario, or Reset to clear the boxes and start over.
What Is Conditional Probability?
Conditional probability is the chance that one event happens when you already know another event happened. We write it as P(A | B), and we read it as "the probability of A given B." The straight line means "given."
Knowing that B happened shrinks the world you look at. Instead of counting every possible outcome, you only count the outcomes where B happened.
The Conditional Probability Formula
P(A | B) = P(A ∩ B) ÷ P(B)
- P(A ∩ B) is the joint probability, the chance A and B both happen.
- P(B) is the chance B happens on its own. It must be more than 0, because you cannot divide by zero.
If you have raw counts instead of decimals, use: P(A | B) = count(A and B) ÷ count(B).
A Simple Example
Say 50 students studied for a test, and 35 of them passed. Let A = "passed" and B = "studied." Then P(A | B) = 35 ÷ 50 = 0.70, or 70%. Among students who studied, 7 out of 10 passed.
Reading a 2×2 Table
A 2×2 contingency table sorts data into four boxes: both events, one event only, the other event only, and neither. Row totals and column totals let you find many probabilities at once. For P(A | B), divide the "both" cell by its row total. For P(B | A), divide the same cell by its column total. These two answers are often different, and mixing them up is a common mistake.
Independent vs. Dependent Events
Two events are independent when one does not change the other. That is true when P(A | B) = P(A), or when P(A) × P(B) = P(A ∩ B). Coin flips and dice rolls are independent. If the numbers do not match, the events are dependent, which means knowing B tells you something new about A. Rain and carrying an umbrella are dependent.
Things to Watch For
- P(A ∩ B) can never be bigger than P(A) or P(B).
- P(A | B) and P(B | A) are not the same thing.
- count(B) means the number of times B happened, not the whole sample size.
- P(Ac | B) = 1 − P(A | B). This is the chance A does not happen, given B.
Where People Use It
Doctors use conditional probability to read medical test results. Weather forecasters use it to predict rain. Banks use it to judge loan risk, and spam filters use it to sort email. It is also the base for Bayes' theorem, which flips a conditional around: P(B | A) = P(A | B) × P(B) ÷ P(A).