Joint Probability Calculator

Find the probability that two events both occur. Choose the method that matches what you know: independent events, a conditional probability, a known union, or a 2 by 2 table of counts. Every result shows its formula, its steps and the four outcome regions.

The overall probability that A occurs. Enter a decimal from 0 to 1.
The overall probability that B occurs.

This method assumes A and B are independent: knowing one occurred does not change the probability of the other.

The probability of B once you know A happened, not the overall probability of B.
The probability of A once you know B happened, not the overall probability of A.
A or B, including both. It must be at least the larger of P(A) and P(B), and at most their sum.

Enter how many outcomes fall in each cell. Rows are event A, columns are event B.

Counts of outcomes for events A and B
B occursB does not occur
A occurs
A does not occur

Whole numbers only. Row, column and grand totals are worked out for you, and the grand total must be above zero.

Enter the required values above and the result appears here automatically.

Reset calculator?

Are you sure you want to reset? Your entered values and the current result will be cleared.

What this joint probability calculator does

Joint probability answers the question “how likely is it that A and B both happen?” The calculator returns P(A and B) as a decimal and a percentage, shows the formula with your numbers substituted, and explains the answer in plain language. It also reports the quantities that follow from it, such as P(A or B), the conditional probabilities and whether A and B look independent.

Short answer: for independent events, P(A and B) = P(A) × P(B). In general, P(A and B) = P(A) × P(B | A). With P(A) = 0.5 and P(B) = 0.25 for independent events, P(A and B) = 0.125, or 12.5%.

Unlike many quick tools, this calculator does not assume independence for you. The first menu names the method, and the result states which one was used. When one event changes the chance of the other, the independent product is wrong, so the calculator offers methods for conditional probabilities, a known union and counts. For the conditional side of the same relationship, see the Conditional Probability Calculator; for general single-event problems, the Probability Calculator.

Which method to choose: when is the information enough?

The choice is not a matter of taste. It depends on what you actually know, because P(A) and P(B) on their own generally do not determine the joint probability. Two pairs of events can have the same single-event probabilities and overlap very differently: two mutually exclusive events never overlap, while two events where one sits inside the other overlap as much as possible. The table shows which information is sufficient.

What each combination of known values lets you conclude
What you knowWhat it determinesMethod on the calculator
P(A), P(B) and the events are independentExactly P(A) × P(B)Independent events
P(A) and P(B | A), or P(B) and P(A | B)Exactly the product of the twoDependent events
P(A), P(B) and P(A or B)Exactly P(A) + P(B) − P(A or B)A known union
Counts in the four cells of a 2 by 2 tableExactly the both-events count divided by the grand total2 by 2 table
Only P(A) and P(B), independence unknownOnly a range, from max(0, P(A) + P(B) − 1) up to min(P(A), P(B))None: not enough information

When only P(A) and P(B) are known and independence has not been established, the honest answer is a range. The calculator shows that range in every result as a check. With P(A) = 0.8 and P(B) = 0.7, for example, the events must overlap by at least 0.5, because together they would otherwise cover more than 100% of outcomes.

Inputs and definitions

The notation below is used throughout the page. The most common source of wrong answers is mixing up the overall probability of an event with its probability given another event.

Event A and event B
Any two outcomes or sets of outcomes of the same experiment, such as “the coin shows heads” and “the card is a heart”.
Joint probability, P(A and B)
The probability that both events occur in the same trial. It is the event intersection, the overlap of A and B in a Venn diagram.
Marginal probability, P(A) or P(B)
The overall probability of one event, ignoring the other. In a table it is a row or column total divided by the grand total.
Conditional probability, P(B | A)
The probability of B once you know A occurred. It is measured among the outcomes where A occurs, so it is not the same as the overall probability of B, and it is not the same as P(A and B).
Conditioning event
The event you are told has occurred, the one after “given”. In P(B | A) it is A. It must have a probability above 0 for the conditional probability to be defined.
Joint cell count
In a 2 by 2 table, the number of outcomes in the cell where both A and B occur. Dividing it by the grand total gives the joint probability.
Union probability, P(A or B)
The probability that at least one of the two events occurs, including both.
Sample space
The set of all possible outcomes. Probabilities are shares of it, so they are numbers from 0 to 1 (0% to 100%).

Probabilities can be entered as decimals from 0 to 1 or as percentages from 0 to 100; switching the setting converts the values you have already typed. In the dependent-events method, pick the form that matches your data: P(A) with P(B | A), or P(B) with P(A | B). Entering the other single-event probability is optional, but it lets the calculator check that your values are consistent and show P(A or B) and the four outcome regions.

The joint probability formulas

Every method on the calculator is one of these rules, or a rearrangement of one. They agree with each other: the multiplication rule is the definition of conditional probability turned around, and independence is the special case where the conditional probability equals the marginal probability.

  • Independent events: P(A and B) = P(A) × P(B)
  • General multiplication rule: P(A and B) = P(A) × P(B | A) = P(B) × P(A | B)
  • Conditional probability: P(B | A) = P(A and B) / P(A), for P(A) > 0
  • Addition rule: P(A or B) = P(A) + P(B) − P(A and B)
  • Joint from a union: P(A and B) = P(A) + P(B) − P(A or B)
  • Mutually exclusive events: P(A and B) = 0
  • From counts: P(A and B) = count(both A and B) / grand total
  • Limits from P(A) and P(B): max(0, P(A) + P(B) − 1) ≤ P(A and B) ≤ min(P(A), P(B))

How to read the step-by-step result

Each result opens with the answer as a decimal and a percentage, followed by a one-sentence interpretation. The table lists the related quantities, and the numbered steps show the selected formula, your numbers substituted into it and the arithmetic. The four-region table splits all outcomes into both A and B, A only, B only and neither, which is the table equivalent of a Venn diagram. The tree and the meter show the same result another way. The decimal places menu changes only how many digits are displayed; the arithmetic runs at full precision, and a value that is not exactly 0 or 1 is never displayed as exactly 0 or 1.

Worked example 1: independent events

A fair coin is flipped and, separately, one card is drawn from a well-shuffled standard deck. Let A be “heads” and B be “the card is a heart”. The coin cannot influence the card, so the events are independent, which is why the product rule applies.

P(A) = 0.5 and P(B) = 13/52 = 0.25, so P(A and B) = 0.5 × 0.25 = 0.125, or 12.5%. The union is P(A or B) = 0.5 + 0.25 − 0.125 = 0.625. Choose Independent events and press Fill with an example to load these values.

Worked example 2: dependent events without replacement

A bag holds 5 marbles, 2 red and 3 blue. Two marbles are drawn without putting the first back. Let A be “the first is red” and B be “the second is red”. After a red first draw, 4 marbles remain and 1 of them is red, so the second draw depends on the first.

  • Two marbles from a bag of 5 (2 red, 3 blue), no replacement
    • First marble redP = 2/5
      • Second redP = 1/4Both: 2/20
      • Second blueP = 3/4Path: 6/20
    • First marble blueP = 3/5
      • Second redP = 2/4Path: 6/20
      • Second blueP = 2/4Path: 6/20

P(A) = 2/5 = 0.4 and P(B | A) = 1/4 = 0.25, so P(A and B) = 0.4 × 0.25 = 0.1. Treating the draws as independent would give 0.4 × 0.4 = 0.16, which is too high because it ignores that one red marble has already gone. By symmetry P(B) = 0.4, so the calculator also reports that the events are dependent: the joint probability 0.1 is below the independent value 0.16, meaning that a red first marble makes a red second marble less likely. Choose Dependent events with P(A) and P(B | A) to reproduce it.

Joint probability from a two-way contingency table

When data come as counts of people, items or observations, the joint probability is a share of the whole table. The four cells of a 2 by 2 table are: both A and B, A only, B only, and neither. Their counts add up to the grand total, and the row and column totals are the counts for each event on its own.

Commuter example: counts of 200 people (invented figures for illustration)
Late (B)Not lateRow total
Takes the train (A)30 (both A and B)70 (A only)100
Does not take the train20 (B only)80 (neither)100
Column total50150200

Of 200 commuters, 30 take the train and are late, so P(A and B) = 30 / 200 = 0.15. The marginal probabilities are P(A) = 100 / 200 = 0.5 and P(B) = 50 / 200 = 0.25, and the union is (30 + 70 + 20) / 200 = 0.6, which matches 0.5 + 0.25 − 0.15. If the events were independent the joint probability would be 0.5 × 0.25 = 0.125, so train travellers in this invented data are late more often than chance alone would suggest. The same numbers are in the 2 by 2 table method, and the known union method reaches 0.15 again from P(A) = 0.5, P(B) = 0.25 and P(A or B) = 0.6.

Joint, marginal and conditional probability compared

These three kinds of probability use the same counts but different numerators and denominators. The same example makes the difference visible:

The same 200 commuters: only the numerator and denominator change
ProbabilityTypeNumeratorDenominatorValue
P(A and B)Joint30, both A and B200, grand total0.15
P(A)Marginal100, A row total200, grand total0.5
P(B)Marginal50, B column total200, grand total0.25
P(B | A)Conditional30, both A and B100, A row total0.3
P(A | B)Conditional30, both A and B50, B column total0.6

Joint probability divides by the grand total, marginal probability divides a row or column total by the grand total, and conditional probability divides by the total of the group you are given. That is why P(B | A) = 0.3 is larger than P(A and B) = 0.15: it looks only at the 100 commuters who take the train. The multiplication rule connects them: P(A and B) = P(A) × P(B | A) = 0.5 × 0.3 = 0.15. The conditional side of this table is explored further in the Conditional Probability Calculator, and a row or column total divided by the grand total is also called a marginal probability.

Independence versus mutual exclusivity

These two ideas are often confused, and they are close to opposites. Events are independent when knowing one occurred does not change the probability of the other, so P(A and B) = P(A) × P(B). Events are mutually exclusive (disjoint) when they cannot occur together, so P(A and B) = 0.

If two events each have a positive probability and cannot overlap, knowing that A occurred tells you B did not, so they are dependent. On one roll of a die, “1” and “2” are mutually exclusive with a joint probability of 0, while the product P(A) × P(B) = 1/36 is positive, so they are not independent. Conversely, independent events with positive probabilities can always occur together. The result table states which relationship the numbers show: independent, dependent with a positive association, dependent with a negative association, or mutually exclusive.

Joint probability and union probability

The union, P(A or B), is the probability that at least one event occurs. It is linked to the joint probability by the addition rule, P(A or B) = P(A) + P(B) − P(A and B): adding P(A) and P(B) counts the overlap twice, so one copy is subtracted. This is also why the union method works backwards from a known union to the overlap. For mutually exclusive events the overlap is 0 and the union is simply the sum. For a fuller picture of overlapping sets, the Venn Diagram Calculator is the visual companion.

This calculator handles two events. For three events, the same ideas extend through the chain P(A and B and C) = P(A) × P(B | A) × P(C | A and B), which the Probability of 3 Events Calculator is intended to cover. A full joint probability distribution, which lists a probability for every combination of values of two random variables, is a wider topic; a 2 by 2 table of event probabilities is its simplest case.

Edge cases and input checks

The calculator stops and explains the problem, instead of showing a misleading number, when:

  • a probability is below 0 or above 1 (or outside 0% to 100% in percent mode);
  • in the dependent-events method, the event you are given has probability 0, which makes the conditional probability undefined because the formula divides by that probability;
  • the joint probability implied by a conditional probability is larger than the other event's probability, or smaller than P(A) + P(B) − 1;
  • in the union method, P(A or B) is smaller than the larger of P(A) and P(B), or larger than P(A) + P(B);
  • a table count is negative or not a whole number, or the grand total is zero.

A zero joint probability is not an error: it means the events never occur together. If you enter two small probabilities whose product is too small to represent, the calculator says so rather than printing a false 0. When a conditional probability cannot be defined for a result, the table says “undefined” and gives the reason.

Common mistakes to avoid

  • Multiplying when the events are not independent. P(A) × P(B) is the joint probability only under independence. Without replacement, or when one event influences the other, use a conditional probability.
  • Using P(B) where P(B | A) belongs. After A occurs, the chance of B may be different from its overall chance.
  • Adding instead of multiplying. “A and B” needs both to happen, which is harder than either alone; adding probabilities relates to “A or B” for exclusive events.
  • Dividing by the wrong total in a table. The joint probability uses the grand total; a conditional probability uses a row or column total.
  • Treating a joint probability above a single-event probability as possible. The overlap can never be larger than either event.
  • Assuming mutually exclusive means independent. They are different ideas, as shown above.

Assumptions and limitations

  • The calculator applies the elementary rules for two events. It does not estimate probabilities from data or quantify sampling error.
  • The independent method is only as valid as the independence assumption. The calculator cannot verify it from P(A) and P(B) alone.
  • Table mode treats the counts as the whole group of interest. Generalising to a wider population needs inference, such as a chi-square test of independence.
  • Probabilities typed as rounded decimals can look slightly inconsistent, for example 1/3 entered as 0.333. The calculator allows a small tolerance (1 in a billion) when checking consistency, but results from rounded inputs are rounded too.
  • This calculator provides a mathematical result from the values you enter. It is an informational and educational tool, not professional or statistical advice. For decisions that matter, consult a qualified professional.

Formula sources

The multiplication rule, independence, mutually exclusive events, the addition rule and the two-way table definitions were checked against these independent references:

The limits on the joint probability from P(A) and P(B) are not separately cited: they follow from P(A and B) ≤ P(A), P(A and B) ≤ P(B) and P(A or B) ≤ 1 combined with the addition rule.

Frequently asked questions

What is joint probability?

Joint probability is the probability that two events both occur in the same trial or observation, written P(A and B). It is the overlap, or intersection, of the two events. For example, the joint probability that a fair coin shows heads and a card drawn from a standard deck is a heart is 0.5 × 0.25 = 0.125.

How do you calculate the probability that both A and B occur?

It depends on what you know. For independent events multiply the two probabilities, P(A and B) = P(A) × P(B). When one event changes the chance of the other, multiply the probability of one event by the conditional probability of the other, P(A and B) = P(A) × P(B | A). From a table of counts, divide the count where both occur by the grand total. If you know P(A or B), use P(A and B) = P(A) + P(B) − P(A or B).

What formula should I use for independent events?

Use P(A and B) = P(A) × P(B). Two events are independent when knowing that one occurred does not change the probability of the other, as with two separate coin flips. If A and B are not independent, this product is not the joint probability and gives a wrong answer.

How do you calculate joint probability for dependent events?

Dependent events are events where one changes the probability of the other, so the plain product P(A) × P(B) no longer applies. Instead, use the general multiplication rule: multiply the probability of the first event by the probability of the second event given that the first occurred. For two marbles drawn without replacement from a bag of 5 with 2 red, P(first red) = 2/5 and P(second red | first red) = 1/4, so P(both red) = 2/5 × 1/4 = 0.1.

How do you find joint probability when a conditional probability is given?

Multiply the conditional probability by the probability of the event it is conditioned on: P(A and B) = P(A) × P(B | A), or the reversed form P(B) × P(A | B). Use the form that matches your data, because P(B | A) pairs with P(A) and P(A | B) pairs with P(B). For example, with P(B) = 0.25 and P(A | B) = 0.6, the joint probability is 0.25 × 0.6 = 0.15. The conditioning event must have a probability above 0, otherwise the conditional probability is undefined.

Can you find joint probability from P(A) and P(B) alone?

Not exactly, unless you also know the events are independent. P(A) and P(B) only limit the joint probability to a range, from max(0, P(A) + P(B) − 1) up to the smaller of P(A) and P(B). With P(A) = 0.5 and P(B) = 0.25 the joint probability could be anywhere from 0 to 0.25. You need independence, a conditional probability, a union probability or counts to pin it down.

How do you calculate joint probability from a two-way table?

Divide the count in the cell where both events occur by the grand total of the whole table. If 30 of 200 people both take the train and arrive late, the joint probability is 30 / 200 = 0.15. Row and column totals divided by the grand total give the marginal probabilities.

What is the difference between joint, marginal, and conditional probability?

Joint probability, P(A and B), is the chance that both occur out of all outcomes. Marginal probability, such as P(A), is the chance of one event ignoring the other. Conditional probability, such as P(B | A), is the chance of one event among only the outcomes where the other occurred. In a table the numerators and denominators differ: joint divides a cell by the grand total, marginal divides a row or column total by the grand total, and conditional divides a cell by a row or column total.

How can you tell whether two events are independent?

Check whether P(A and B) equals P(A) × P(B). Equivalently, check whether P(B | A) equals P(B) when P(A) is above 0. If the joint probability is larger than the product, the events occur together more often than independence predicts; if it is smaller, less often. In a count table, the test is whether the both-events count times the grand total equals the A row total times the B column total.

What is the joint probability of mutually exclusive events?

It is 0, because mutually exclusive events cannot occur together. On one roll of a die, "rolling a 1" and "rolling a 2" are mutually exclusive, so P(A and B) = 0. Such events are not independent when both have positive probability, because P(A) × P(B) is above 0 while the joint probability is 0.

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

P(A and B) is the probability that both events occur. P(A or B) is the probability that at least one occurs, which includes the case where both do. They are linked by the addition rule: P(A or B) = P(A) + P(B) − P(A and B). The joint probability is never larger than the union probability.

Can joint probability be greater than 1?

No. A joint probability lies between 0 and 1, and it can never exceed either single-event probability, because both events cannot occur together more often than each occurs alone. A calculated value above 1, or above P(A) or P(B), means an input is wrong or the events were treated as independent when they are not.