Home/Statistics/Probability Calculator

Probability Calculator

Calculate single-event, AND, OR, conditional probability and Bayes' theorem — with full step-by-step working. Accepts decimals, percentages, fractions or favorable/total outcome counts.

Quick Answer: How Do You Calculate Probability?

The basic formula is P(A) = favorable outcomes ÷ total outcomes, always a number between 0 and 1. For two events: P(A and B) = P(A) × P(B) if independent; P(A or B) = P(A) + P(B) − P(A and B); and conditional probability P(A|B) = P(A and B) ÷ P(B) — the chance of A, given that B has already happened.

Choose What to Calculate

Accepts a decimal (0.25), a percentage (25%), or a fraction (1/4).

Results
Probability
ResultValue
Quick Formula Summary
Single event: P(A) = favorable / total
Complement: P(A') = 1 − P(A)
AND (independent): P(A∩B) = P(A) × P(B)
OR (general): P(A∪B) = P(A) + P(B) − P(A∩B)
OR (mutually exclusive): P(A∪B) = P(A) + P(B)
Conditional: P(A|B) = P(A∩B) / P(B)
Bayes' theorem: P(A|B) = P(B|A) × P(A) / P(B)

Probability Guide

What Is Probability?

Probability is a number between 0 and 1 that measures how likely an event is. A probability of 0 means the event is impossible; a probability of 1 means it's certain. In its simplest form, it's the number of favorable outcomes divided by the total number of possible outcomes.

P(A) = (favorable outcomes) / (total possible outcomes)

The Complement Rule

The complement of an event A (written A') is everything that isn't A. Since an event either happens or it doesn't, P(A) and P(A') always add up to exactly 1.

P(A') = 1 − P(A)

AND: Two Events Both Happening

For independent events (where one doesn't affect the other), multiply their probabilities:

P(A and B) = P(A) × P(B)   (independent events only)

For dependent events, this doesn't work — you need the actual (or conditional) probability of the intersection, which this calculator lets you enter directly.

OR: At Least One Event Happening

For events that can't happen together (mutually exclusive), just add the probabilities:

P(A or B) = P(A) + P(B)   (mutually exclusive only)

For events that can overlap, adding them double-counts the overlap, so it has to be subtracted back out:

P(A or B) = P(A) + P(B) − P(A and B)

Why This Calculator Rejects Some Inputs

If you tell this calculator P(A) = 0.6 and P(B) = 0.5, there's a real mathematical limit on what P(A∩B) can be — it can't be more than the smaller of the two (0.5, since A∩B can never be bigger than either event alone), and it can't be less than P(A)+P(B)−1 = 0.1 either (since the two events have to overlap by at least that much to both fit within a total probability of 1). This valid range is called the Fréchet bounds. Most simple calculators only check that a probability is between 0 and 1 — this one checks the more precise, more genuinely useful constraint, and explains why when a combination is impossible.

ℹ️ Example: P(A)=0.6, P(B)=0.5 → P(A∩B) must be between 0.1 and 0.5. Entering 0.6 for the intersection isn't just unusual, it's mathematically impossible given those two individual probabilities.

Conditional Probability

Conditional probability is the probability of A given that B has already happened — written P(A|B). It asks: "now that we know B occurred, what's left for A?"

P(A|B) = P(A∩B) / P(B)

If A and B are independent, knowing B happened tells you nothing new about A, so P(A|B) simply equals P(A).

Bayes' Theorem

Bayes' theorem flips a conditional probability around — updating the probability of A given new evidence B, when what you actually know is the probability of the evidence given A (and given not-A):

P(A|B) = P(B|A) × P(A) / P(B)   where P(B) = P(B|A)×P(A) + P(B|A')×P(A')

The classic surprising result: a "99% accurate" medical test

A disease affects 1% of the population: P(Disease) = 0.01
The test correctly detects the disease 99% of the time: P(Positive|Disease) = 0.99
But it also has a 5% false-positive rate: P(Positive|No Disease) = 0.05
P(Positive) = 0.99×0.01 + 0.05×0.99 = 0.0594
P(Disease|Positive) = 0.99×0.01 / 0.0594 ≈ 16.7%
Despite a "99% accurate" test, a positive result only means a 16.7% chance of actually having the disease — because the disease is rare, false positives from the healthy 99% of the population outnumber true positives from the sick 1%. This is exactly why Bayes' theorem matters: intuition badly misleads most people here.

Worked Examples

Dice — rolling two sixes with two dice

P(six on die 1) = 1/6, P(six on die 2) = 1/6, independent events
P(both sixes) = 1/6 × 1/6 = 1/36 ≈ 2.78%

Coins — heads twice in a row

P(heads) = 0.5 each flip, independent
P(heads, then heads) = 0.5 × 0.5 = 0.25 (25%)

Cards — two aces, without replacement

P(first card is an ace) = 4/52
P(second card is an ace | first was an ace) = 3/51, since one ace and one card are now gone
P(both aces) = 4/52 × 3/51 = 1/221 ≈ 0.45% — genuinely different from drawing with replacement (4/52 × 4/52 ≈ 0.59%), because the events are dependent

Lottery — a 6-from-49 draw

Total combinations = C(49,6) = 13,983,816
P(matching all 6 numbers) = 1 / 13,983,816 ≈ 0.0000072% — a genuinely tiny number that "1 in 14 million" doesn't always make intuitive

Real-world — medical screening (Bayes' theorem)

See the worked Bayes' theorem example above — a positive result on a "99% accurate" test for a rare disease still only means a 16.7% chance of actually having it

Real-World Applications

FieldUse
MedicineInterpreting test results correctly requires Bayes' theorem — a positive result's real meaning depends heavily on how common the condition is
Finance and insuranceRisk pricing, actuarial tables, and portfolio diversification all rely on independent-vs-dependent event probability
Quality controlProbability of a defect given a certain production condition — classic conditional probability
Weather forecasting"70% chance of rain" is a probability estimate built from historical conditional frequencies
Games and gamblingCard counting, dice odds, and lottery expectations are all direct probability applications

Common Mistakes

MistakeFix
Multiplying probabilities for dependent eventsP(A)×P(B) only works for independent events — dependent events need the actual conditional probability
Forgetting to subtract the overlap in "OR" calculationsP(A)+P(B) double-counts the overlap unless the events are mutually exclusive
Confusing P(A|B) with P(B|A)These are generally different numbers — "probability of rain given clouds" isn't the same as "probability of clouds given rain." Bayes' theorem exists specifically to convert between them
Assuming a "99% accurate" test means a positive result is 99% reliableIt depends heavily on how rare the condition is — see the worked Bayes' theorem example above
Treating "with replacement" and "without replacement" the same for cards or drawsRemoving an item changes the probabilities for every subsequent draw — the two aces example above shows a real, meaningful difference
⏱️ Last Updated: August 2026 | Reviewed by Mohsin Iqbal

🔑 Key Takeaways

  • Probability is always between 0 and 1 — favorable outcomes divided by total outcomes
  • P(A)×P(B) only works for independent events; dependent events need the real conditional probability
  • P(A or B) needs the overlap subtracted, unless the events are mutually exclusive
  • Conditional probability P(A|B) and Bayes' theorem let you correctly reverse "probability of evidence given a cause" into "probability of a cause given evidence"
  • A "99% accurate" test can still mean a low real-world reliability for a positive result, if the underlying condition is rare — always run the actual numbers

Practice Questions

Beginner (with answers)

  1. A standard deck has 52 cards, 4 of them kings. What is P(drawing a king)?
  2. What is P(drawing a heart or a king) from a standard deck?
  3. What is the complement of P(A) = 0.35?
  4. Two independent events have P(A)=0.5 and P(B)=0.5. What is P(A and B)?
  5. If P(A) = 0.4, what is P(not A)?
Show answers

1) 4/52 ≈ 0.0769 (7.69%)   2) 13/52+4/52−1/52 = 16/52 ≈ 0.3077 (there's one card, the king of hearts, in both groups, so it's subtracted once)   3) 1−0.35 = 0.65   4) 0.5×0.5 = 0.25   5) 1−0.4 = 0.6

Advanced (with answers)

  1. P(A)=0.4, P(B)=0.3, P(A∩B)=0.1. Find P(A or B).
  2. A test has P(Disease)=0.02, P(Positive|Disease)=0.95, P(Positive|No Disease)=0.02. Find P(Disease|Positive) using Bayes' theorem.
  3. P(A)=0.6, P(B)=0.5. What is the valid range for P(A∩B)?
  4. Three coin flips: what is P(exactly 2 heads)?
  5. Drawing two cards without replacement, what is P(both are aces)?
Show answers

1) 0.4+0.3−0.1 = 0.6   2) P(Positive) = 0.95×0.02+0.02×0.98 = 0.0386, P(Disease|Positive) = 0.95×0.02/0.0386 ≈ 49.2%   3) between max(0,0.6+0.5−1)=0.1 and min(0.6,0.5)=0.5   4) C(3,2)×0.5³ = 3×0.125 = 0.375   5) 4/52 × 3/51 = 1/221 ≈ 0.45%

Formula Cheat Sheet

Quick Reference

Single event: P(A) = favorable / total  |  Complement: P(A') = 1 − P(A)
AND (independent): P(A∩B) = P(A) × P(B)  |  OR (general): P(A∪B) = P(A) + P(B) − P(A∩B)
OR (mutually exclusive): P(A∪B) = P(A) + P(B)  |  Conditional: P(A|B) = P(A∩B) / P(B)
Bayes' theorem: P(A|B) = P(B|A)×P(A) / P(B)  |  Fréchet bounds: max(0,P(A)+P(B)−1) ≤ P(A∩B) ≤ min(P(A),P(B))

Glossary

Sample space
The complete set of all possible outcomes of a random experiment — e.g. {1,2,3,4,5,6} for a single die roll.
Independent events
Events where the outcome of one has no effect on the probability of the other, such as two separate coin flips.
Dependent events
Events where the outcome of one changes the probability of the other, such as drawing cards without replacement.
Mutually exclusive events
Events that cannot both happen at the same time — rolling a 3 and rolling a 5 on the same single die roll, for example.
Fréchet bounds
The mathematically valid range for P(A∩B) given only P(A) and P(B) — a genuine constraint, not just "between 0 and 1."

Frequently Asked Questions