Probability of A Given B Calculator

This probability of A given B calculator finds the conditional probability P(A | B) and P(B | A) from two event probabilities and one more value. It also gives the joint and union probabilities and tests independence.

Checks on your data

  • P(A | B) and P(B | A) are different quantities and are often confused. Use the Bayes working in the steps to convert between them.

Results

P(A | B)
0.3
30 %
P(B | A)
0.4
40 %
P(A and B)
0.12
P(A or B)
0.58
P(neither)
0.42
P(A only)
0.18
P(B only)
0.28
Independent?
Yes: P(A and B) = P(A)·P(B)
P(A)·P(B) = 0.12
Lift P(A and B) / (P(A)P(B))
1
no association
The four outcomes (probabilities add to 1)
00.20.4A and B: 0.12A and B0.12A only: 0.18A only0.18B only: 0.28B only0.28Neither: 0.42Neither0.42
Conditional versus unconditional
00.10.20.30.4P(A): 0.3P(A)0.3P(A | B): 0.3P(A | B)0.3P(B): 0.4P(B)0.4P(B | A): 0.4P(B | A)0.4
Two-way probability table
BNot BTotal
A0.120.180.3
Not A0.280.420.7
Total0.40.61
Show step-by-step solution
  1. P(A and B) = 0.12 (given).
  2. P(A | B) = P(A and B) ÷ P(B) = 0.12 ÷ 0.4 = 0.3.
  3. P(B | A) = P(A and B) ÷ P(A) = 0.12 ÷ 0.3 = 0.4.
  4. P(A or B) = P(A) + P(B) − P(A and B) = 0.58.
  5. Bayes: P(A | B) = P(B | A) P(A) ÷ P(B) = 0.4 × 0.3 ÷ 0.4 = 0.3.
DefinitionP(A|B) = P(A∩B)/P(B)
IndependentP(A∩B) = P(A)P(B)
UnionP(A)+P(B)−P(A∩B)
BayesP(B|A)P(A)/P(B)

What Is Probability of A Given B?

Conditional probability is the probability of an event A given that another event B has occurred: P(A | B) = P(A and B) ÷ P(B). It is the foundation of Bayes theorem and of how new information updates a probability.

Enter P(A), P(B) and either the joint probability P(A and B) or one of the conditionals. The calculator returns both conditional probabilities, P(A and B), P(A or B), P(neither), the lift and whether the events are independent, along with a two-way probability table.

The sections below explain the formulas, variables, a worked example and common questions about the difference between P(A | B) and P(B | A).

How to Use the Probability of A Given B Calculator

  1. Enter P(A) and P(B).
  2. Choose which third value you know: the joint probability or either conditional.
  3. Enter it.
  4. Read both conditionals, the union and the independence test.

Probability of A Given B Formula

Conditional probability

P(A∣B)=P(A∩B)P(B)P(A\mid B)=\frac{P(A\cap B)}{P(B)}

Multiplication rule

P(A∩B)=P(A∣B) P(B)P(A\cap B)=P(A\mid B)\,P(B)

Bayes theorem

P(A∣B)=P(B∣A) P(A)P(B)P(A\mid B)=\frac{P(B\mid A)\,P(A)}{P(B)}

Union

P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B)=P(A)+P(B)-P(A\cap B)

Probability of A Given B Variables Explained

SymbolMeaningNotes
P(A), P(B)Probability of each event
P(A and B)Joint probabilityboth occur
P(A | B)Probability of A given B
P(A or B)Union probabilityP(A) + P(B) − P(A and B)

Probability of A Given B Worked Example

Suppose P(A) = 0.30, P(B) = 0.40 and P(A and B) = 0.12. Then P(A | B) = 0.12 ÷ 0.40 = 0.30 and P(B | A) = 0.12 ÷ 0.30 = 0.40. Because P(A)P(B) = 0.12 equals P(A and B), the events are independent.

With the example values loaded in the calculator above, the steps are:

  1. P(A and B) = 0.12 (given).
  2. P(A | B) = P(A and B) ÷ P(B) = 0.12 ÷ 0.4 = 0.3.
  3. P(B | A) = P(A and B) ÷ P(A) = 0.12 ÷ 0.3 = 0.4.
  4. P(A or B) = P(A) + P(B) − P(A and B) = 0.58.
  5. Bayes: P(A | B) = P(B | A) P(A) ÷ P(B) = 0.4 × 0.3 ÷ 0.4 = 0.3.

Result: P(A | B) = 0.3; P(B | A) = 0.4.

How to Read a Conditional Probability

P(A | B) is the probability of A once you know B has happened. It equals P(A and B) ÷ P(B). With P(A) = 0.30, P(B) = 0.40 and P(A and B) = 0.12, P(A | B) = 0.30 and P(B | A) = 0.40.

Because P(A | B) equals P(A), knowing B tells you nothing about A, and the events are independent. The lift P(A and B) ÷ (P(A)P(B)) is 1 for independent events, above 1 when A and B occur together more than chance, and below 1 when they avoid each other.

Where Probability of A Given B Is Used

Conditional probability

Find P(A | B) from P(A and B) and P(B).

Reversing a condition

Compute P(B | A) with Bayes’ rule from P(A), P(B) and P(A | B).

Independence

Test whether P(A and B) equals P(A)P(B).

Two-way tables

See every region of the A and B diagram.

Common Probability of A Given B Mistakes to Avoid

  • P(A | B) and P(B | A) are different. Mixing them up is the commonest error.
  • Independence means P(A and B) = P(A)P(B).
  • Mutually exclusive events with positive probabilities are not independent.
  • All probabilities must lie between 0 and 1, and P(A and B) cannot exceed either one.

Probability of A Given B Terms and Definitions

Joint probability
The probability that both events occur.
Independent events
Events where knowing one occurred does not change the probability of the other.

Probability of A Given B FAQs

How do you calculate conditional probability?

Divide the probability of both events by the probability of the condition: P(A | B) = P(A and B) ÷ P(B). For 0.12 ÷ 0.40 the answer is 0.30.

What is the difference between P(A|B) and P(B|A)?

P(A | B) is the chance of A given B, and P(B | A) is the chance of B given A. They are equal only when P(A) = P(B).

How do I test whether two events are independent?

Check whether P(A and B) = P(A) × P(B). If it does, the events are independent. In the example, 0.30 × 0.40 = 0.12, so they are.

What if I only know P(B | A)?

Then P(A and B) = P(A) × P(B | A), which gives the joint probability you need. The calculator accepts it as the third value.

Related calculators

Last updated 2026-11-09. See our disclaimer.