Coin Run Probability Calculator
Ask people how likely six heads in a row is somewhere in a hundred flips and most say a few percent. It is more likely than not. That gap is why streaks get read as evidence — of a hot hand, of a rigged coin, of a run being due to end — when they are simply what randomness looks like from close up. This counts the answer exactly rather than estimating it, and then lets you simulate two thousand runs to watch the measured figures land on the computed ones.
What this generator does
Gives the exact probability that a run of a given length appears anywhere in a sequence of fair coin flips, the full distribution of the longest run, and the average longest run. The other probability tools here — the permutation calculator, the birthday problem — count arrangements or collisions. This one counts sequences containing a pattern, which is a different problem with a different recurrence, and it is the one that produces the answers people find hardest to believe.
How to use this tool
- Set how many flips there are.
- Set the run length you want to ask about.
- Press Work out the odds.
- Press Now simulate 2,000 runs to see measured results next to the exact ones.
Understanding the controls
- Number of flips
- How long the sequence is. Every one of the 2^n possible sequences is accounted for, so raising this makes long runs likelier — the single most counter-intuitive part of the whole subject.
- Run length to ask about
- How many identical results in a row. The headline answer is the chance of a run *at least* this long occurring anywhere, which is not the same as the chance of it starting at a particular flip — the difference is most of why intuition fails here.
Worked examples
- 6 in a row, 100 flips
- More likely than not — over 50%. The number most people put around 2%.
- 5 in a row, 100 flips
- Over 80%. A run of five is close to expected, not remarkable.
- Average longest run in 100 flips
- About 7. Roughly log₂ of the number of flips, which is why doubling the flips adds only one to the expected streak.
- 10 in a row, 20 flips
- Under 1% — this is the shape of a genuinely surprising streak.
Common use cases
- Settling an argument about whether a streak means a coin or a shuffle is rigged
- Teaching the gambler's fallacy with numbers rather than assertion
- Working out how long a streak has to be before it is genuinely surprising
- Checking a random number generator's output against what runs should look like
- Showing a class the difference between an exact probability and a measured one
How this generator works
The count is exact and done in integers. The number of sequences with no run of a given length has a clean recurrence — a sequence with no long run is a series of alternating blocks each shorter than the run length, so the count is the number of ways to compose the total length from those block sizes, doubled for the two choices of starting symbol. Subtracting that from 2^n gives the number of sequences that do contain a run, and dividing gives the probability. Everything is bigint arithmetic until the final division, because 2^200 is a 61-digit number and a floating-point version of this loses precision exactly in the tail, which is the interesting part. The longest-run distribution is derived by difference — a longest run of exactly k means a run of k occurred and a run of k+1 did not — so there is only one place the counting can be wrong. The simulation is separate, uses the browser's cryptographic random number generator, and is there to be compared rather than to produce the answer.
Randomness and fairness
The probabilities on this page are computed, not sampled — they are exact counts over every possible sequence, and would be identical on any machine. Randomness enters only when you press the simulate button, which runs two thousand sequences using the browser's cryptographic random number generator so the measured figures can be held against the exact ones. The gap you see between the two columns is sampling error, and it shrinks as the number of simulated runs grows.
For how randomness is produced across the whole site, see how Generate Random works.
Assumptions this tool makes
- Each flip is independent and lands heads or tails with equal probability. Edge landings, spins and biased tosses are not modelled.
Limitations and good to know
- It assumes a fair coin and independent flips. A real coin is very close to fair; a shuffled playlist, a slot machine or a sports team is not, and none of them is modelled here.
- Above 500 flips the exact count is still correct but the numbers stop being informative — the answer is essentially certain for any run length people ask about.
- It counts runs of either symbol. The chance of six *heads* specifically is roughly half the figure shown, and that distinction catches people out.
- This is about what randomness produces, not about detecting bias. A long run is not evidence of a rigged coin, and a formal test for bias is a different tool.
Common mistakes
- Thinking a run means the next flip is more likely to break it
- It does not, and this is the gambler's fallacy in its purest form. The coin has no memory. After six heads the chance of a seventh is exactly one half, and the reason long runs feel impossible is that we underestimate how many chances a hundred flips gives them to start.
- Confusing 'a run of six somewhere' with 'six in a row starting now'
- Six specific flips all landing heads is 1 in 64. A run of six appearing anywhere in a hundred flips has about ninety-five places to start, and comes out over 50%. Almost all the surprise lives in that difference.
- Reading a long streak as evidence of bias
- The average longest run in a hundred fair flips is about seven. Seeing seven is the expected outcome, not a signal. A genuinely suspicious result would be a streak far outside this page's distribution, or a long-run head proportion well away from a half.
Practical tips
- Try 100 flips and a run of 6, then 200 flips and the same run. Doubling the flips barely changes the expected longest streak — it grows like the logarithm, not the length.
- Set the run length to 1 to see the distribution alone: it is the clearest picture of where streaks actually sit.
- Run the simulation twice. The measured column moves and the exact column does not, which is the whole lesson in one gesture.
Privacy and your data
Two numbers are entered and neither leaves your browser. The counting and the simulation both happen on your device — nothing is uploaded and no result is stored.
Frequently asked questions
- Is six heads in a row really more likely than not?
- In a hundred flips, yes — the exact figure is above 50%, and you can read it off the page. It surprises people because they picture six specific flips, which is 1 in 64. A hundred flips offers ninety-five overlapping opportunities for such a run to begin, and those opportunities add up quickly.
- How long a streak should actually surprise me?
- Compare it against the distribution on this page rather than against intuition. In a hundred flips the longest run averages about seven, so seven is unremarkable and ten is worth a second look. In a thousand flips ten is unremarkable. The threshold moves with the number of trials, which is exactly why 'that can't be random' is such an unreliable instinct.
- Why use exact counting rather than a formula?
- Because the well-known approximations for run probabilities are good in the middle and poor in the tail, and the tail is where the questions are. Counting integers has no error at all, and 2^500 is no harder for a bigint than 2^10.
- Does this apply to anything other than coins?
- To anything that is genuinely a sequence of independent, equally likely two-way outcomes — a fair die read as odd or even, a well-implemented random bit stream. It does not apply to sports form, shuffled music, or roulette after a run, all of which either are not independent or are not fair, and all of which are where people most want to apply it.
Related generators
- Random Walk SimulatorTakes a walk one coin flip at a time, draws the path, and says exactly how unusual the finish was.
- Permutation and Combination CalculatornPr and nCr side by side, exactly, with the difference between them worked through rather than assumed.
- Birthday Problem CalculatorHow many people before a shared birthday becomes likely — and the same arithmetic for IDs, codes and hashes.