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
- Enter P(A and B) and P(B) as decimals.
- Optionally enter P(A).
- 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
- P(A | B) = 0.12 ÷ 0.3 = 0.4.
- 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.

