Skip to content
DeviceCheckHub

Probability Calculator

The chance of A and B, A or B, neither or exactly one, of k successes in n tries, or P(A) and P(B) from any two facts, with a diagram and steps.

Your events

Type a probability as a decimal (0.25), a percentage (25%) or a fraction (1/4, or 1 in 4).

For independent events with P(A) = 0.5 and P(B) = 0.4, the chance of both is 20% and of at least one is 70%.

P(A and B) = 0.2

P(A or B) = 0.7, and P(neither) = 0.3.

Venn diagram: the chance of A only, of both, of B only and of neither.AB30%20%20%Neither30%
Every probability
EventProbabilityPercentOdds
A and B0.220%1 in 5
A or B0.770%1 in 1.43
Exactly one0.550%1 in 2
Neither0.330%1 in 3.33
Not A0.550%1 in 2
Not B0.660%1 in 1.67
A given B0.550%1 in 2
B given A0.440%1 in 2.5

Step by step

  1. Independent events: P(A and B) = P(A) × P(B) = 0.5 × 0.4 = 0.2.
  2. P(A or B) = P(A) + P(B) − P(A and B) = 0.5 + 0.4 − 0.2 = 0.7.
  3. P(exactly one) = P(A or B) − P(A and B) = 0.7 − 0.2 = 0.5.
  4. P(neither) = 1 − P(A or B) = 1 − 0.7 = 0.3.
  5. P(A given B) = P(A and B) / P(B) = 0.2 / 0.4 = 0.5, the same as P(A): knowing B happened doesn’t change the chance of A.

How to use the probability calculator

  1. Choose what to work out. Two events combines the chances of two events, A and B. Repeated trials finds the chance of a number of successes in a run of tries, such as heads in coin flips. Find P(A) and P(B) works backwards from any two things you know about two independent events.
  2. Enter the probabilities as decimals, percentages or fractions. For two events, say whether they are independent, can’t both happen, or whether you know the chance of both.
  3. Read the answer, the Venn diagram or the chart, a table of every related probability with its percentage and odds, and the steps.

What a probability is

A probability is a number from 0 to 1 that says how likely something is: 0 means it can’t happen and 1 means it is certain. When every outcome is equally likely, it is the number of outcomes you want divided by the number of possible outcomes. A fair die has six faces, so the chance of a 4 is 1/6, about 0.167 or 16.7%. The same chance can be written as odds of “1 in 6”. The chance that something does not happen is 1 minus the chance that it does, so the chance of not rolling a 4 is 5/6.

The probability of A and B

OpenStax’s Introductory Statistics puts the key idea simply: “Two events A and B are independent events if the knowledge that one occurred does not affect the chance the other occurs.” For independent events, the chance that both happen is the product of their chances: P(A and B) = P(A) × P(B). Two heads in two coin flips has probability 1/2 × 1/2 = 1/4.

When the events affect each other, use the general multiplication rule, P(A and B) = P(B) × P(A given B), where P(A given B) is the chance of A once you know B happened. Drawing two cards without putting the first back is the classic case: the chance of two aces is 4/52 × 3/51 = 1/221, because after one ace only three of the remaining 51 cards are aces. To use this in the calculator, choose “I know P(A and B)” and enter the chance of both.

The probability of A or B

“A or B” means at least one of them happens. The addition rule is P(A or B) = P(A) + P(B) − P(A and B). The last term matters: adding P(A) and P(B) counts the outcomes where both happen twice, so they are taken away once. With P(A) = 0.5 and P(B) = 0.4 for independent events, P(A and B) = 0.2 and P(A or B) = 0.5 + 0.4 − 0.2 = 0.7.

OpenStax defines the special case: “A and B are mutually exclusive events if they cannot occur at the same time.” Then P(A and B) = 0 and the rule becomes a plain sum. The chance of rolling a 1 or a 2 on one die is 1/6 + 1/6 = 1/3. From the same pieces you also get the chance of exactly one of the two, P(A or B) − P(A and B), and of neither, 1 − P(A or B). The Venn diagram shows all four parts, which always add up to 100%.

Conditional probability

The chance of A given B, written P(A | B), is the probability of A when you already know that B happened: P(A given B) = P(A and B) / P(B). If A and B are independent it is simply P(A), which is a good way to check for independence. If they are not, it can be very different. For example, if 30% of customers buy coffee, 10% buy coffee and a pastry, and 20% buy a pastry, then the chance that a pastry buyer also buys coffee is 0.1 / 0.2 = 50%, well above the 30% for everyone. The calculator shows P(A given B) and P(B given A) for any two events.

Repeated trials and the binomial distribution

Many questions ask about the same chance repeated: heads in ten coin flips, faulty parts in a batch, or wins in a run of games. OpenStax lists “three characteristics of a binomial experiment”: a fixed number of trials, only two outcomes for each one (success or failure), and “The n trials are independent and are repeated using identical conditions.” The chance of exactly k successes in n trials, each with chance p, is

P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ

where C(n, k) counts the ways to choose which k trials succeed. For exactly five heads in ten fair flips, that is 252 × (1/2)¹⁰ = 63/256 ≈ 0.246094, so even the most likely result happens less than a quarter of the time. The average number of successes is n × p and the standard deviation is √(n × p × (1 − p)). The calculator adds up the right terms for “at most”, “at least”, “fewer than” and “more than”, works with up to a billion trials, and gives exact fractions for up to 200 trials when you type a fraction.

The chance of at least one

“At least once” is easiest to find from the opposite: the chance of never succeeding is (1 − p)ⁿ, so the chance of at least one success is 1 − (1 − p)ⁿ. The chance of at least one six in four rolls of a die is 1 − (5/6)⁴ = 671/1296, or 51.7747%, just better than even. The chance of at least one double six in 24 rolls of two dice looks similar, but is 49.1404%, just worse than even.

The same formula tells you how many tries you need. With a 1% chance each time, you need 69 tries for an even chance of at least one success, 230 for 90% and 459 for 99%. The calculator shows these numbers for your chance in repeated trials mode.

Common mistakes

Your data stays on your device

Everything is worked out in your browser. Nothing you type is sent anywhere or stored.

Frequently asked questions

How do you find the probability of A and B?

If A and B are independent, multiply: P(A and B) = P(A) × P(B). For two coin flips, the chance of two heads is 1/2 × 1/2 = 1/4. If they are not independent, multiply P(B) by the chance of A given that B happened: P(A and B) = P(A given B) × P(B).

How do you find the probability of A or B?

Add the two probabilities and take away the overlap, so it isn’t counted twice: P(A or B) = P(A) + P(B) − P(A and B). For two coin flips, the chance of at least one head is 1/2 + 1/2 − 1/4 = 3/4. When A and B can’t happen together, the overlap is 0 and you just add.

What is the probability of at least one success?

It is 1 minus the chance of no successes at all: 1 − (1 − p)ⁿ for n independent tries with chance p each. The chance of at least one six in four rolls of a die is 1 − (5/6)⁴ = 671/1296, about 51.7747%.

What is the difference between independent and mutually exclusive events?

Independent events don’t affect each other’s chances, like two coin flips. Mutually exclusive events can’t both happen, like rolling a 1 and a 2 on the same roll. Two events with chances above zero can’t be both: if one rules the other out, knowing it happened changes the other’s chance to 0.

How do I enter a probability?

As a decimal (0.25), a percentage (25%), a fraction (1/4) or as “1 in 4”. When you type fractions, the answers are shown as exact fractions too.

Is anything I type saved or sent?

No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.

Last updated · About DeviceCheckHub