Probability Calculator

Calculate probability for single events, two independent events, and conditional probability. Includes visual bars, presets, and step-by-step work.

Calculate probability for single events, pairs of independent events, and conditional probability. Results are shown as decimals, percentages, and simplified fractions with visual probability bars and step-by-step working. Probability sits at the foundation of statistics, finance, gambling, insurance, and machine learning, and the basic rules in this calculator are the same ones used by actuaries and data scientists every day.

Ad
Ad

About Probability Calculator

Basic Probability Formula

For an event A with equally likely outcomes:

P(A) = favourable outcomes / total possible outcomes

Probability is always a number between 0 and 1, where 0 means impossible and 1 means certain. Multiply by 100 to convert to a percentage. The classical definition above assumes every outcome has the same chance, which is true for fair coins, fair dice, and well-shuffled cards but not for things like the weather or sports results.

Worked example: Drawing a heart from a standard 52-card deck:

  • Favourable outcomes: 13 hearts
  • Total outcomes: 52 cards
  • P(heart) = 13/52 = 1/4 = 0.25 = 25%

Common Probability Values

EventProbabilityFractionPercentage
Coin lands heads0.51/250%
Roll a 6 on a die0.16671/616.67%
Roll even on a die0.53/650%
Draw an ace from a deck0.07694/527.69%
Draw a face card0.230812/5223.08%
Two heads in a row0.251/425%
Three sixes in a row0.00461/2160.46%
Royal flush in poker (5 cards)0.00000154/2,598,9600.000154%

Complement Rule

The probability of an event NOT happening is:

P(not A) = 1 - P(A)

This is often easier than counting unfavourable outcomes directly. If P(rain) = 0.30, then P(no rain) = 0.70. The complement rule is useful for "at least one" questions: rather than adding the probability of exactly 1, exactly 2, exactly 3 successes, calculate the probability of zero successes and subtract from 1.

Worked example: What is the chance of getting at least one six when rolling four dice? P(no sixes on one die) = 5/6, so P(no sixes on four dice) = (5/6)^4 = 0.482. Therefore P(at least one six) = 1 - 0.482 = 0.518, or about 51.8%. This is the famous De Mere problem from the 17th century, which prompted the early correspondence between Pascal and Fermat that founded probability theory.

Two Independent Events

Two events are independent when one has no effect on the other. The key formulas:

FormulaMeaningExample
P(A and B) = P(A) × P(B)Both happenTwo heads in a row: 0.5 × 0.5 = 0.25
P(A or B) = P(A) + P(B) - P(A and B)At least one happensAt least one head in two flips: 0.5 + 0.5 - 0.25 = 0.75
P(neither) = (1-P(A)) × (1-P(B))Neither happensNo heads: 0.5 × 0.5 = 0.25

Worked example: You roll two dice. What is the probability of rolling a 6 on at least one?

  1. P(6 on die 1) = 1/6, P(6 on die 2) = 1/6
  2. P(A or B) = 1/6 + 1/6 - (1/6 × 1/6) = 2/6 - 1/36 = 11/36 ≈ 0.306

The intuitive answer "1/6 + 1/6 = 1/3" overcounts the case where both dice show 6, which is why the multiplication term is subtracted. This pattern shows up everywhere in probability and is called the inclusion-exclusion principle.

Conditional Probability

Conditional probability asks: given that B happened, what is the probability of A?

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

Worked example: In a class of 30 students, 18 study maths, 12 study physics, and 8 study both. If a student studies physics, what is the probability they also study maths?

  1. P(maths ∩ physics) = 8/30
  2. P(physics) = 12/30
  3. P(maths | physics) = (8/30) / (12/30) = 8/12 = 2/3 ≈ 0.667

The condition narrows the sample space from 30 students to 12 physics students, then asks how many of those also study maths. This is exactly how Bayes' theorem works: it lets you update probabilities as new evidence arrives, which is the core of medical diagnosis, spam filtering, and most modern AI systems.

Key Probability Rules

RuleFormulaWhen to Use
Addition (mutually exclusive)P(A or B) = P(A) + P(B)Events cannot happen together
Addition (general)P(A or B) = P(A) + P(B) - P(A∩B)Events may overlap
Multiplication (independent)P(A and B) = P(A) × P(B)Events don't affect each other
Multiplication (dependent)P(A and B) = P(A) × P(B|A)Events affect each other
ComplementP(not A) = 1 - P(A)Easier to count what doesn't happen
Total probabilityP(A) = Σ P(A|Bi) × P(Bi)Combine probabilities across cases
Bayes' theoremP(A|B) = P(B|A) × P(A) / P(B)Reverse a conditional probability

The Birthday Problem

How many people need to be in a room for a 50% chance of two sharing a birthday? The answer is surprisingly low: just 23. This is because you are comparing every pair, and with 23 people there are 253 pairs to check. The exact formula uses the complement: P(at least one match) = 1 - (365/365 × 364/365 × 363/365 × ... × (365-n+1)/365).

People in RoomProbability of a Match
1011.7%
2041.1%
2350.7%
3070.6%
5097.0%
7099.9%

This counter-intuitive result, also known as the birthday paradox, comes from how quickly the number of pairs grows. With 23 people there are 253 possible pairings, each with about a 1/365 chance of matching. The same maths is what makes hash collisions in cryptography happen far sooner than people expect, which is why secure hash functions need very large output sizes.

Common Mistakes to Avoid

The Gambler's Fallacy: believing past random events influence future ones. After five reds in a row at roulette, black is not "due" - the wheel has no memory and the next spin is still about 48.6% red on a European wheel (with one zero) or 47.4% on an American wheel (with two zeros). Each spin is independent. The same misunderstanding leads people to chase lottery numbers that have not come up recently.

Confusing P(A|B) with P(B|A): these are usually different. The probability someone is sick given a positive test is not the same as the probability of a positive test given they are sick. This is the basis of the prosecutor's fallacy in court cases and many bad medical decisions. Bayes' theorem is the formal way to switch between the two.

Adding probabilities for non-mutually-exclusive events: P(king or heart) is not 4/52 + 13/52 = 17/52, because the king of hearts is counted twice. The correct answer is 4/52 + 13/52 - 1/52 = 16/52.

Multiplying probabilities for dependent events as if they were independent: drawing two aces in a row from a 52-card deck without replacement is (4/52) × (3/51) = 0.0045, not (4/52)^2 = 0.0059. The second draw has fewer cards and one fewer ace.

Where Probability Shows Up in Real Life

Insurance pricing uses probability tables built from decades of claims data. UK actuarial life tables published by the Continuous Mortality Investigation give the probability of death in the next year for any age and sex, and these feed directly into life insurance premiums and annuity rates. A 65-year-old man in the UK has roughly a 1.4% chance of dying within the year, and that figure roughly doubles every 8 years after age 30 (a pattern known as Gompertz' law).

Medical screening: a test that is 99% accurate sounds great until you do the maths. If a disease affects 1 in 1,000 people, then in 10,000 people there will be roughly 10 true positives and 100 false positives, so a positive test means only about a 9% chance of really having the disease. This is why doctors confirm screening results with second tests.

Sports analytics: win probability models in baseball and football are built from millions of historical plays. FiveThirtyEight popularised live win probability charts that update after every play using conditional probability based on the score, time remaining, and field position.

Machine learning: every classifier outputs a probability. A spam filter does not just say "spam or not spam" - it computes P(spam | email content) using Bayes' theorem and a learned vocabulary of words that tend to appear in spam. Modern image classifiers do the same with thousands of object categories, returning a softmax distribution over all classes that always sums to 1.

Odds vs Probability

Odds and probability describe the same thing in different ways. Probability is favourable / total, while odds are favourable to unfavourable. A 25% probability is the same as 1-to-3 odds (one favourable for every three unfavourable), and a 50% probability is 1-to-1 (often called "even money"). Bookmakers in the UK quote fractional odds, while continental European bookmakers use decimal odds and US sportsbooks use moneyline odds. The conversion is straightforward:

ProbabilityFractional (UK)Decimal (EU)Moneyline (US)
10%9/110.00+900
25%3/14.00+300
50%1/1 (evens)2.00+100
66.7%1/21.50-200
80%1/41.25-400

Real-world bookmaker odds bake in a margin (the overround), so the implied probabilities of all outcomes add up to slightly more than 100%. A typical Premier League match has an overround of about 5-7%, meaning the bookmaker keeps that fraction as profit on average.

For counting arrangements and selections that underpin probability, the permutations and combinations calculator handles nPr and nCr. For standard deviation calculations used in probability distributions, the standard deviation calculator computes spread from raw data, and the percentage calculator converts probabilities into the percentage form most people prefer to read.

All calculations run in your browser. No data is sent to any server.

Sources

Frequently Asked Questions

How do I calculate basic probability?

Divide the number of favorable outcomes by the total number of possible outcomes. For example, rolling a 6 on a standard die has probability 1/6 because there is 1 favorable outcome out of 6 total.

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

P(A and B) is the probability that both events happen. For independent events, it equals P(A) multiplied by P(B). P(A or B) is the probability that at least one event happens, which equals P(A) + P(B) minus P(A and B).

What is conditional probability?

Conditional probability P(A|B) is the probability of event A occurring given that event B has already occurred. It is calculated as P(A and B) divided by P(B). The condition (event B happening) narrows down the sample space.

What are independent events?

Two events are independent when the outcome of one does not affect the probability of the other. For example, two coin flips are independent since the first flip result has no influence on the second.

Can I enter fractions instead of decimals?

The single event calculator accepts favorable and total outcomes as whole numbers and displays the result as a simplified fraction. For the two-event and conditional calculators, enter probabilities as decimals between 0 and 1.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/probability-calculator/" title="Probability Calculator - Free Online Tool">Try Probability Calculator on ToolboxKit.io</a>