The conditional probability calculator above takes the two facts that pin down a pair of events — how often each one happens on its own, and how often they happen together — and returns every conditional probability those facts imply. The headline is P(A|B), the probability of A once you already know B occurred. Underneath it you get the reverse conditional P(B|A), the probability of A when B did not occur, the union, and a lift figure showing how far the pair sits from independence.
Arb Digital publishes free calculators for the arithmetic that quietly decides real conclusions. Conditional probability is the clearest example, because the formula is one line and the interpretation is where everything goes wrong. This page therefore refuses to show a single number in isolation: it decomposes the pair into all four joint cells, checks that the inputs are internally consistent, and flags when the two events are more or less associated than chance would produce.
What This Conditional Probability Calculator Does
It reconstructs the complete two-by-two joint distribution of two events from whatever you give it. In probability mode you supply P(A), P(B) and P(A and B) as percentages. In counts mode you supply the four cell counts from a contingency table and the tool divides through by the total. Either way it fills in the whole table: both, A only, B only, neither — and derives all the conditionals from those cells rather than from the formula alone, which is why it can also tell you when the numbers you typed describe a situation that cannot exist.
Two neighbouring tools cover adjacent ground. Our Bayes' theorem calculator inverts a conditional: it starts from P(B|A) and a prior, and works backwards to P(A|B). This page does the opposite job — it computes and decomposes conditionals directly from joint and marginal facts you already have, with no prior-updating involved. Our probability calculator covers single events and independent combinations, where conditioning does not enter at all. Use Bayes when you have a test's accuracy and want to invert it; use this page when you have a table of how often things co-occur.
How to Use It
- Decide which event is the condition. B is what you already know happened. Getting this the wrong way round produces a perfectly valid answer to the wrong question.
- Enter the two marginals. P(A) and P(B) are the overall rates, measured across everything, not within each other.
- Enter the joint probability. This is how often both occur in the same case. It is not the product of the marginals unless the events happen to be independent.
- Or switch to counts. If you are working from a real table, typing the four raw counts avoids a rounding step and lets the tool derive the marginals for you.
- Check the consistency line. If the joint probability is impossible given the marginals, the tool says so instead of returning a number above 100%.
The Formula and How It's Calculated
The definition is P(A|B) = P(A and B) ÷ P(B), valid whenever P(B) is greater than zero. Conditioning is a rescaling: you throw away every case where B did not happen, and ask what fraction of what remains also has A. The denominator shrinks from the whole sample space to just B, which is why a conditional probability is almost always larger than the joint probability it came from.
Take the defaults. P(A) = 30%, P(B) = 40% and P(A and B) = 18%. Then P(A|B) = 18 ÷ 40 = 45%, and the reverse conditional is P(B|A) = 18 ÷ 30 = 60%. The union follows from the addition rule, P(A or B) = P(A) + P(B) − P(A and B) = 30 + 40 − 18 = 52%. The remaining conditional needs the complement: A happens without B in 30 − 18 = 12% of cases, and not-B covers 60% of cases, so P(A | not B) = 12 ÷ 60 = 20%. Every one of those appears above, so the worked example is easy to verify by hand. Wolfram MathWorld's entry on conditional probability states the same definition and its multiplication-rule rearrangement.
Reading All Four Cells Instead of One Number
A pair of binary events has exactly four possible joint outcomes, and every conditional you might want is a ratio of sums of those four cells. Writing them out removes almost all the confusion. With the defaults the cells are: both, 18%; A without B, 12%; B without A, 22%; neither, 48%. They add to 100%, which is the first sanity check worth doing.
Now every question becomes a division. P(A|B) is the both cell over the B row, 18/(18+22) = 45%. P(B|A) is the both cell over the A column, 18/(18+12) = 60%. P(not A | not B) is the neither cell over the not-B row, 48/(48+12) = 80%. Doing it this way makes it obvious why the numerator is shared between P(A|B) and P(B|A) while the denominators are completely different, which is precisely why the two values differ. The bar breakdown above the article shows those four cells to scale.
The cells also recover the marginal you started from, which is the law of total probability: P(A) = P(A|B)×P(B) + P(A | not B)×P(not B). Here that is 45% × 40% + 20% × 60% = 18% + 12% = 30%, exactly the P(A) you typed. Wolfram MathWorld's entry on the total probability theorem states the general n-case version. It is worth running that check whenever conditionals arrive from a source you did not compute yourself, because a pair of conditionals that will not reassemble into the stated base rate cannot all be right.
When the Numbers You Typed Are Impossible
Not every combination of P(A), P(B) and P(A and B) describes a situation that can occur. The joint probability is boxed in from both sides by what are known as the Fréchet bounds. It can never exceed the smaller of the two marginals, because the overlap of two sets cannot be bigger than either set. Less obviously, it can never fall below P(A) + P(B) − 1: if A happens 80% of the time and B happens 70% of the time, they are forced to overlap at least 50% of the time simply because there is not enough room in the sample space for them to avoid each other.
Try it. Set P(A) to 80, P(B) to 70 and the joint to 40. The calculator reports the inputs as inconsistent and shows the permitted range, rather than returning a number that looks fine and is not. This check matters most when the three figures come from different sources — two survey questions reported separately and an overlap estimated by someone else. If the trio fails the bound, at least one of the three is wrong, and no amount of downstream arithmetic will fix it.
Independence, Association and the Lift Figure
Two events are independent when knowing one tells you nothing about the other, which happens exactly when P(A and B) = P(A) × P(B). The fourth grid item divides the actual joint probability by that independent-case product, giving a ratio usually called lift. A lift of 1 means independence; above 1 means the events co-occur more often than chance; below 1 means they co-occur less often.
With the defaults, independence would predict 30% × 40% = 12%, but the observed joint is 18%, so the lift is 1.5. B raises the chance of A by half again over its base rate, from 30% to 45%. That comparison — conditional against unconditional, not conditional against some absolute threshold — is the one that tells you whether conditioning did anything at all. A P(A|B) of 45% sounds high until you notice the base rate was 30% and the increase is modest, and it would be no news whatsoever if P(A) had also been 45%.
Lift is symmetric, incidentally: P(A|B)/P(A) always equals P(B|A)/P(B). That is a useful check on your own reasoning, because it means association has no direction. Establishing that two events are associated says nothing about which one causes the other, or whether either does. Where you want to test whether an observed association in a table is more than sampling noise, our chi-square calculator is the standard next step, and our confusion matrix calculator presents the same four cells in the precision-and-recall vocabulary used for classifiers.
Where Conditional Probability Gets Misread
The dominant error is transposing the conditional — treating P(A|B) as if it were P(B|A). In the defaults those are 45% and 60%, close enough that a swap might pass unnoticed. In real screening problems they routinely differ by a factor of ten, which is what makes the mistake so costly. Any time a sentence of the form "given X, the chance of Y is Z" appears, it is worth writing out which set is the denominator before accepting the number.
A second and subtler trap is conditioning on a variable that was itself selected. If you only measure A among cases that already passed some filter, your P(A) is a conditional probability wearing a marginal's clothing, and combining it with a joint probability measured on the full population produces nonsense. This is the same structural problem behind survivorship bias, and it is why the counts mode on this page asks for the "neither" cell explicitly: leaving it out is exactly how a sample gets silently conditioned. Once you are combining rates measured on different populations, our weighted average calculator is often the honest way to recombine them.
Arb Digital's analysts check base rates and denominators before quoting a conversion figure, which is why our reports rarely need retracting.
Browse All Free Tools Talk To Our TeamCommon Mistakes to Avoid
- Swapping the two conditionals — P(A|B) and P(B|A) share a numerator but have different denominators, so they are equal only when P(A) equals P(B).
- Multiplying the marginals to get the joint — that shortcut is only valid under independence, and assuming it when the events are associated understates or overstates the overlap.
- Ignoring the base rate — a conditional probability is only informative next to the unconditional one, which is what the lift figure supplies.
- Entering a joint probability larger than a marginal — the overlap of two events cannot be more common than either event alone.
- Reading association as causation — lift is symmetric and carries no direction, so it can never establish which event drives the other.
Related Free Tools From Arb Digital
Invert a conditional with the Bayes' theorem calculator, handle single and combined events with the probability calculator, test a contingency table for association with the chi-square calculator, weigh outcomes by payoff with the expected value calculator, or read classifier performance from the same four cells with the confusion matrix calculator. The full free online tools hub lists every probability tool we publish.
Frequently Asked Questions
P of A given B equals the probability that both A and B occur, divided by the probability of B. The condition becomes the denominator, so you are asking what share of the B cases also contain A.
They share the same numerator, the joint probability, but divide by different denominators. They are equal only in the special case where A and B have the same overall probability.
Bayes' theorem inverts a conditional you already have, turning P of B given A into P of A given B using a prior. This page computes conditionals directly from joint and marginal probabilities, with no inversion or prior involved.
The two events are independent. The joint probability equals the product of the marginals, so knowing that B occurred does not change the probability of A at all.
No. It cannot exceed the smaller marginal, and it cannot fall below the sum of the marginals minus one. Values outside that range describe a situation that cannot occur.
The conditional is undefined, because you would be dividing by zero. Conditioning on an event that never happens leaves nothing to compute a proportion from.
No. The lift figure is symmetric, so it reads identically in both directions and carries no information about direction of influence or about a shared third cause.