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).
Bayes' theorem updates the probability of A given new evidence B — for example, the probability someone has a disease, given a positive test result.
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):
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
Field
Use
Medicine
Interpreting test results correctly requires Bayes' theorem — a positive result's real meaning depends heavily on how common the condition is
Finance and insurance
Risk pricing, actuarial tables, and portfolio diversification all rely on independent-vs-dependent event probability
Quality control
Probability 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 gambling
Card counting, dice odds, and lottery expectations are all direct probability applications
Common Mistakes
Mistake
Fix
Multiplying probabilities for dependent events
P(A)×P(B) only works for independent events — dependent events need the actual conditional probability
Forgetting to subtract the overlap in "OR" calculations
P(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% reliable
It 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 draws
Removing 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)
A standard deck has 52 cards, 4 of them kings. What is P(drawing a king)?
What is P(drawing a heart or a king) from a standard deck?
What is the complement of P(A) = 0.35?
Two independent events have P(A)=0.5 and P(B)=0.5. What is P(A and B)?
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)
P(A)=0.4, P(B)=0.3, P(A∩B)=0.1. Find P(A or B).
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.
P(A)=0.6, P(B)=0.5. What is the valid range for P(A∩B)?
Three coin flips: what is P(exactly 2 heads)?
Drawing two cards without replacement, what is P(both are aces)?
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
Probability is a number between 0 and 1 that measures how likely an event is to happen. A probability of 0 means the event is impossible; a probability of 1 means it's certain. It's calculated as the number of favorable outcomes divided by the total number of possible outcomes.
Divide the number of favorable outcomes by the total number of possible outcomes: P(A) = favorable ÷ total. For example, P(rolling a 4 on a die) = 1/6.
The basic formula is P(A) = favorable outcomes ÷ total outcomes. For combined events, P(A∩B) covers "and," P(A∪B) covers "or," and P(A|B) covers conditional probability.
Conditional probability is the probability of an event occurring given that another event has already happened, written P(A|B). It's calculated as P(A∩B) ÷ P(B).
Independent events are events where the outcome of one has no effect on the probability of the other. For independent events, P(A and B) = P(A) × P(B).
Dependent events are events where the outcome of one affects the probability of the other, such as drawing cards from a deck without replacement — removing one card changes the odds for the next draw.
Bayes' theorem calculates the probability of an event based on prior knowledge of related conditions: P(A|B) = P(B|A) × P(A) / P(B). It's used to correctly update a probability estimate as new evidence arrives.
Odds express the same information as probability differently: odds in favor = favorable outcomes : unfavorable outcomes. A probability of 0.25 (1/4) corresponds to odds of 1:3 — one favorable outcome for every three unfavorable ones.
1/6, or about 16.67%, on a standard fair six-sided die — each of the six faces is equally likely.
1/36, or about 2.78% — the two dice rolls are independent, so multiply 1/6 by 1/6.
Divide the number of matching cards by the total (52 for a standard deck). For a second card drawn without replacement, recalculate using 51 remaining cards, and one fewer matching card if the first draw matched.
4/52, which simplifies to 1/13, or about 7.69% — there are 4 aces in a standard 52-card deck.
Every subsequent draw has one fewer card in the deck (and possibly one fewer matching card, if the removed card matched). This makes card draws without replacement dependent events — you can't just multiply the original probabilities.
It depends on the exact lottery format, but for a typical 6-from-49 draw, the odds are about 1 in 13,983,816 — roughly 0.0000072%, an extremely small but non-zero probability.
Experimental (or empirical) probability is based on actually observed results from repeated trials — the number of times an event occurred divided by the number of trials — rather than theoretical reasoning about equally likely outcomes.
Theoretical probability is calculated from reasoning about equally likely outcomes, without needing to run any actual trials — for example, knowing a fair coin has a 50% chance of heads just from its symmetry, without flipping it once.
Combinations count how many ways a set of outcomes can occur when order doesn't matter — used to find the total number of possible outcomes in problems like lottery odds or card hands, which then becomes the denominator in a probability calculation.
A probability tree is a diagram that maps out every possible sequence of outcomes across multiple events, with branches showing each step's probability — multiplying along a branch gives the probability of that specific sequence.
No — probability is always between 0 and 1 inclusive. A value greater than 1 or less than 0 always indicates an error somewhere in the calculation or input.
Because probability represents a proportion of favorable outcomes out of all possible outcomes — you can never have more favorable outcomes than total outcomes (giving a maximum of 1), and you can never have a negative count of outcomes (giving a minimum of 0).
The complement of event A (everything that isn't A) always satisfies P(A) + P(A') = 1, since an event either happens or it doesn't. So P(A') = 1 − P(A).
The union (A∪B, "or") is everything in A, B, or both. The intersection (A∩B, "and") is only the outcomes that are in both A and B simultaneously.
Events that cannot both happen at the same time — rolling a 3 and rolling a 5 on the same single die roll, for example. For mutually exclusive events, P(A∩B) = 0, and P(A or B) simplifies to just P(A) + P(B).
P(A|B) reads as "the probability of A given B" — the probability that A happens, in the specific scenario where we already know B has happened.
Given P(A) and P(B), there's a mathematically valid range for P(A∩B) called the Fréchet bounds — it can't exceed the smaller of P(A) and P(B), and it can't be less than P(A)+P(B)−1. A value outside that range is genuinely impossible, not just unusual, so the calculator explains why rather than silently accepting it.
Yes — enter probabilities as a decimal (0.5), a percentage (50%), or a fraction (1/2), and the calculator parses all three formats automatically.
Yes — every calculation includes a step-by-step working section showing exactly how the result was derived, plus the exact formula used.
Interpreting diagnostic test results correctly requires Bayes' theorem — a positive result's real-world reliability depends heavily on how common the underlying condition actually is, which is why "99% accurate" tests can still mean a surprisingly low chance of truly having a rare condition.
Risk pricing, actuarial tables for insurance, and portfolio diversification all rely on understanding independent versus dependent event probability, and on correctly modeling combined risks.
It's the correct way to update a belief when new evidence arrives — used in medical diagnosis, spam filtering, legal reasoning about evidence, and machine learning. Without it, people routinely and badly misjudge how reliable a positive test result actually is for a rare condition.
The calculator rejects it with an explanation — a probability greater than 1 (or less than 0) is never mathematically valid, so this is treated as an input error rather than calculated through.
Yes — this calculator is completely free, requires no signup, and covers single events, AND, OR, conditional probability, and Bayes' theorem all in one tool.