StatGardenREF. DESK
Calculators/Statistics/Coin flip probability
Statistics

Coin flip probability calculator

Flips a virtual coin and works out the probability of a given number of heads.

What this calculator does

This tool does two things at once: it will flip a coin for you right now, and it works out the probability behind that flip. Enter how many coins you want flipped, set the number of heads you care about, and choose whether you want the chance of exactly that many, at least that many, or at most that many.

The thing people get wrong about coin flips is thinking a coin somehow "remembers" what it did last time. It does not. Each flip is independent, so a run of five heads in a row does not make tails any more likely on the sixth flip: the probability of heads on that flip is still whatever you set it to, every single time.

The formula

FormulaP(X=k) = C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ, summed for "at least" or "at most"; mean = np, sd = √(np(1−p))

The chance of exactly k heads in n flips is the number of ways to arrange k heads among n flips, multiplied by the probability of heads raised to the k, multiplied by the probability of tails raised to the remaining flips. "At least" and "at most" add up that same exact-k figure across every relevant value of k.

TermMeaning
nThe number of coins flipped, or the number of times one coin is flipped.
kThe number of heads you are asking about.
pThe probability of heads on a single flip: 50% for a fair coin.
C(n,k)The number of different orders in which k heads can land among n flips.
Expected headsn × p, the average number of heads you would see over many repeats.

The inputs explained

FieldWhat to enter
Number of coins to flipHow many coins to flip, or how many times to flip one coin.
Number of headsThe number of heads you want the probability for.
Probability of heads (%)The chance of heads on a single flip. Leave at 50% for a normal coin, or change it for a weighted or biased coin.
Probability ofWhether you want exactly k heads, at least k heads, or at most k heads.

When to use it

Settling something with a fair flip

The live flip result at the bottom of the calculator is a genuine random draw each time you run it, useful for actually deciding something, not just estimating the odds.

Checking whether a streak is actually unusual

Seeing five heads in a row can feel like the coin is rigged. Setting n to 5, k to 5 and comparing "exactly" against "at least" shows how often that happens by chance alone with an ordinary coin.

Teaching independence and the gambler's fallacy

Because each flip does not depend on the last one, this is a clean way to demonstrate that a run of one outcome never shifts the probability of the next single flip.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does the probability of heads change across a set of 10 flips?

A fixed 10 flips at a 50% chance of heads, across a range of head counts.

10 flips, fair coin, probability of exactly k heads
Number of headsProbability
00.098%
24.39%
420.5%
524.6%
620.5%
84.39%
100.098%
The probability peaks at 5 heads, the expected value for 10 fair flips, and falls away symmetrically as the head count moves further from that midpoint in either direction.

How does a biased coin change the chance of at least 10 heads in 20 flips?

A fixed target of at least 10 heads out of 20 flips, across a range of probabilities of heads.

20 flips, at least 10 heads, coin bias varied
Probability of headsProbability
10%0.001%
30%4.80%
50%58.8%
70%98.3%
90%100.0%
A coin biased toward tails makes at least 10 heads out of 20 unlikely, while a coin biased toward heads makes it close to certain; a fair coin sits roughly in the middle since 10 heads is the expected count.

Questions

What is the probability of getting exactly 3 heads in 5 flips?

Set n to 5, k to 3, leave probability at 50% and choose "exactly". This is a standard coin flip probability question, and the calculator applies the same binomial formula used for any fixed number of independent flips.

Is this the same as a coin flip generator?

A coin flip generator usually just gives you one random result. This calculator does that too, in the live flip line, but also works out the odds behind whatever number of heads you are interested in, which a plain generator does not.

Does a run of heads make tails more likely on the next flip?

No. Each flip is independent of every other one, so the probability of heads on the next flip is still exactly p, regardless of what happened before. Believing otherwise is known as the gambler's fallacy.

What if my coin is not perfectly fair?

Change the probability of heads away from 50% to model a weighted or biased coin. Everything else about the calculation works the same way, since the formula only assumes a fixed, independent probability on each flip, not that the probability equals one half.

For the same maths applied to any kind of repeated trial, not just coins, see the binomial probability calculator. To combine the odds of two separate events, use the probability of events calculator.