Skip to content
Probability Calculator
Menu

Conditional Probability Calculator

Find the probability of A given B, or flip a conditional probability around with Bayes' theorem.

Updated · exact formulas, double precision

Calculate

Decimal, percent or fraction: 0.25, 25% or 1/4.

Decimal, percent or fraction: 0.25, 25% or 1/4.

P(A | B)

0.4

40%
P(A | B) = P(A and B) ÷ P(B) = 0.12 ÷ 0.3

Conditional probability formula

P(A | B) = P(A and B) ÷ P(B)

Example: 30% of students take Spanish (B), and 12% take Spanish and play an instrument (A and B). The chance a Spanish student plays an instrument is 0.12 ÷ 0.30 = 0.4, or 40%.

Bayes' theorem, with a worked example

A condition affects 1% of people. A test catches 90% of cases, but also flags 9% of healthy people. If you test positive, what's the chance you have it?

That surprising result is why screening tests are followed up with a second, more specific test. The calculator does the same math in "Bayes' theorem" mode. For the whole picture across several groups, see the law of total probability.

For independent events, where B doesn't change the chance of A, the basic probability calculator is enough.

Questions people ask

What is the conditional probability formula?

P(A|B) = P(A and B) ÷ P(B), the chance of A given that B happened.

Why is a positive test often wrong for rare conditions?

False positives from the big healthy group swamp the true positives. In the default example only about 9% of positives are real.

Sources

More probability calculators