Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Conditional Probability Calculator

Work out conditional probability P A given B using event probabilities. Helpful for Bayes problems, diagnosis scenarios, and dependent events.

Enter the Details





Result will appear here...


Last updated: May 7, 2026

Created by: Eon Tools Dev Team

Reviewed by: Ankit Khatiwada



What the conditional probability calculator does

Conditional probability is the chance of one event given that another has happened. This calculator takes the chance of event A, the chance of B when A is true, and the chance of B when A is false, and from them works out a full breakdown, including the reverse conditional, the chance of A given that B happened.

It is the engine behind diagnosis problems and any situation where new information updates the odds. Below is how it works and the reversal at its heart.

How to use it

  1. Enter P(A), the chance of event A, as a decimal between 0 and 1.
  2. Enter P(B given A) and P(B given not A), the chance of B in each case, also as decimals.
  3. Press Calculate for the full set of probabilities, or Reset to clear it.

How it works

The definition of a conditional probability is the chance of both events divided by the chance of the one you are conditioning on:

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

The calculator builds every piece it needs from your three inputs. It works out the four joint probabilities, the chances of each combination of A or not-A with B or not-B, and from those the totals and every conditional. So a handful of inputs unfolds into the complete probability picture.

Finding P(B) from the pieces

To divide by P(B), the calculator first has to find it, and that is where the third input earns its place. The overall chance of B is the chance of B when A is true, weighted by how often A is true, plus the chance of B when A is false, weighted by how often A is false:

P(B) = P(A) × P(B given A) + P(not A) × P(B given not A)

This is the law of total probability. It assembles the overall rate of B from the two situations in which B can occur. This is why the calculator asks for the chance of B when A is false, a figure people often forget, and it is exactly what makes the reverse conditional possible.

The reversal that trips people up

The most common mistake in probability is treating the chance of B given A as if it were the same as the chance of A given B. They are not, and the gap between them can be enormous. The chance that a test is positive given a disease is not the chance of the disease given a positive test.

The reason they differ is the base rate, how common A is to begin with. When A is rare, even a strong link from A to B leaves the reverse conditional surprisingly small, because most of the times B happens, it happens for the far more numerous cases where A is false. This calculator does the reversal correctly by folding in that base rate through P(A), which is what keeps the answer honest.

A worked example

Suppose a disease affects 1 percent of people, so P(A) is 0.01. A test catches it 90 percent of the time when present, so P(B given A) is 0.9, but also comes back positive 5 percent of the time when the disease is absent, so P(B given not A) is 0.05.

First the overall chance of a positive test: 0.01 times 0.9 plus 0.99 times 0.05 = 0.009 plus 0.0495 = 0.0585. Then the reverse conditional, the chance of the disease given a positive test, is 0.009 ÷ 0.0585 = about 0.15. Despite a test that sounds 90 percent accurate, a positive result means only around a 15 percent chance of the disease, because the disease is so rare to begin with. That is the base rate at work.

Entering your values

Enter all three probabilities as decimals between 0 and 1, so 90 percent is 0.9. The calculator returns the joint probabilities, the totals, and every conditional, including the reverse conditional P(A given B) that most problems are really after.

Questions people ask

What is conditional probability?

The probability of one event given that another has occurred, found by dividing the chance of both by the chance of the event you are conditioning on.

Why does it ask for the chance of B when A is false?

Because that is needed to work out the overall chance of B, through the law of total probability. Without it, the reverse conditional cannot be found.

Why is P(A given B) not the same as P(B given A)?

Because they depend on the base rates of the events. When A is rare, the reverse conditional is much smaller than people expect, since most occurrences of B come from the common case where A is false.

Is this Bayes' theorem?

It is the same idea. This calculator builds the overall chance of B for you from the pieces. If you already know that overall chance, the Bayes theorem calculator uses it directly.

References

A quick note on where the methods here come from. Conditional probability and the law of total probability are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering conditional probability.

  1. NIST/SEMATECH e-Handbook of Statistical Methods (conditional probability). https://www.itl.nist.gov/div898/handbook/
  2. OpenStax, Introductory Statistics (independent and mutually exclusive events, conditional probability). https://openstax.org/details/books/introductory-statistics-2e


Ankit Khatiwada

Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.