The coin streak probability calculator above computes the exact probability that a run of at least k consecutive identical results appears somewhere in n tosses. It handles the run-of-heads question and the run-of-either-side question separately, because they have very different answers, and it works for biased coins as well as fair ones.
Arb Digital publishes it because runs are the part of randomness that intuition gets most wrong, and because the calculation is genuinely awkward. Our coin flip probability calculator answers the counting question — how many heads in total — using the binomial distribution. Counting totals and detecting runs are different problems: the binomial does not care about order, and a run is entirely a question of order. This page uses a recurrence over the sequence instead, and returns an exact answer rather than an approximation.
What This Coin Streak Probability Calculator Does
It computes four things. The headline is the probability of a run of at least k in your chosen sense. Alongside it, the grid gives the run-of-heads probability and the run-of-either-side probability together, so the gap between them is always visible. It also reports the expected length of the longest run in the whole sequence, and the streak length at which the probability crosses fifty percent — the length you would expect to see about half the time.
All of these are exact, computed by dynamic programming over the sequence rather than by simulation or by one of the asymptotic formulas. That matters at small n, where the well-known approximations are noticeably wrong, and at extreme bias, where they are worse. The one concession to practicality is that n is capped at 2,000 tosses, which is far beyond the range where the answer is interesting.
The bar panel shows the probability of the longest run reaching each of several lengths. That single display answers most of the questions people actually have, because it shows where the cliff is — the length at which a streak stops being routine and starts being remarkable.
How to Use It
- Enter the number of tosses in the sequence you are asking about.
- Enter the streak length. The answer covers runs of at least that length, so a run of seven counts when you asked about five.
- Choose the sense of the question — a run of heads specifically, or a run of either side. The second is usually what "a streak" means in conversation.
- Adjust the head probability to model a biased coin or any other repeated two-outcome trial.
- Read the bars to see the whole profile rather than a single point, which is what builds the intuition.
The Formula and How It Is Calculated
There is no clean closed form for this probability, which is why so many pages give an approximation. The exact method tracks the length of the current run as the sequence is generated. For the run-of-heads question, the state is how many heads have appeared consecutively so far, from zero up to k minus one, plus an absorbing state for "a run of k has already happened". Each toss either extends the current run, with probability p, or resets it to zero, with probability 1 minus p. Once the absorbing state is reached it is never left.
Running that recurrence forward n times and summing the absorbed probability gives the exact answer. The either-side version doubles the state space, tracking both which side the current run is on and how long it is, and absorbing when either reaches k. The cost is linear in n and in k, so even 2,000 tosses is instantaneous.
Take the small case: ten tosses of a fair coin, and a run of five or more of the same side. The exact answer is 222 in 1,024, which is about 21.68 percent. Restricting the question to heads only gives 112 in 1,024, or exactly 7 in 64, which is about 10.94 percent — almost exactly half the either-side figure, because the two single-side events are close to disjoint at this length and simply add. Wolfram MathWorld's page on runs gives the recurrence and the asymptotic results, including the approximation for the expected longest run.
Why Streaks Feel Impossible and Are Not
Ask most people how likely a run of five in a row is in a hundred tosses and the answer comes back low. The exact figure is above 96 percent. A run of six is more likely than not, at about 80 percent. A run of eight happens roughly a third of the time. Even a run of ten appears in just under one sequence in ten.
The reason for the mismatch is that people estimate the probability of a run starting at a specific place and forget how many places there are. In a hundred tosses there are 96 possible starting positions for a run of five. Each has a probability of one in sixteen of producing five identical results from that point, and although those windows overlap heavily and are not independent, the sheer number of opportunities dominates. The same structural error drives the birthday paradox: counting people rather than pairs, or in this case tosses rather than windows.
The practical consequence is that a run in real data is very weak evidence of anything. A trader with six winning months, a basketball player with seven made shots, a website with eight days of rising traffic — none of these is surprising in a long enough sequence, and treating them as signal is exactly the error the calculation exposes. The formal version of this test is the runs test, which the NIST/SEMATECH e-Handbook covers in section 1.3.5.13 on the runs test for detecting non-randomness. It looks at the number of runs rather than the length of the longest one, and it catches both too many runs and too few.
The Expected Longest Run and Its Rule of Thumb
The expected longest run in n fair tosses is close to the base-two logarithm of n, and more precisely it sits slightly above it. For 100 tosses log₂100 is about 6.64 and the expected longest run is close to 7. For 1,000 tosses the logarithm is 9.97 and the expectation is around 10.3. The growth is logarithmic, which is very slow: multiplying the sequence length by a thousand adds only about ten to the longest run.
This tool computes the expectation exactly rather than from the approximation, by summing the probability that the longest run reaches each length. That sum is exact because the expectation of a non-negative integer quantity equals the sum over all thresholds of the probability of reaching that threshold. At small n the exact figure and the logarithmic rule of thumb differ noticeably, which is worth seeing.
The distribution around that expectation is narrow, which is what makes the rule of thumb useful. The longest run in 100 tosses is very likely to be between five and eleven, and it is genuinely rare to see something far outside that band. That narrowness is why the length of the longest run is a reasonable informal test of whether a sequence was generated randomly or written down by a person — people asked to fake a random sequence produce runs that are systematically too short, because they avoid what looks like a pattern. Our coin flip simulator generates real sequences you can inspect for exactly this.
Biased Coins and Other Repeated Trials
Nothing in the method requires a fair coin, and the interesting behaviour appears once you move away from a half. With p = 0.7 the runs of heads become dramatically longer while runs of tails become shorter, and the either-side answer is driven almost entirely by the more likely outcome. At p = 0.9 a run of ten heads in a hundred trials is nearly certain, while a run of ten tails is essentially impossible.
That makes the tool useful well beyond coins. Any repeated trial with two outcomes and a constant probability fits: a free-throw shooter's makes and misses, consecutive days above a temperature threshold, defect-free items off a line, or consecutive profitable trades. The critical assumption is independence — each trial unaffected by the last — and it is the assumption most likely to be false in the interesting cases. If the trials really are dependent, the answer here is a baseline against which the real behaviour can be compared, and the gap between them is the finding. Our conditional probability calculator handles the dependent case directly.
One more distinction worth keeping straight. A run of at least k is not the same as a run of exactly k. This page reports "at least", which is nearly always the question people mean, and which includes every longer run. Asking for exactly k requires a run of that length flanked on both sides by a different result, and it is a smaller number. Our binomial distribution calculator and dice probability calculator cover the related counting problems where order does not matter.
Arb Digital checks whether a pattern in performance data is more than what randomness produces on its own before acting on it.
Browse All Free Tools Talk To Our TeamCommon Mistakes to Avoid
- Confusing a streak with a total — the chance of seven heads out of ten is a binomial question about counts; the chance of seven in a row is a question about order, and the two answers are nothing alike.
- Asking about heads when you meant either side — the either-side probability is close to twice the single-side one at moderate streak lengths, and it is usually what was intended.
- Multiplying by the number of windows — the naive estimate of n minus k plus one, times p to the power k, overcounts badly because overlapping windows are heavily dependent.
- Treating a run as evidence — runs are routine in sequences of any length, and the gambler's fallacy runs in the other direction too: a coin is not "due" a tail after five heads.
- Assuming independence without checking — the whole calculation rests on each trial being unaffected by the last, and in real performance data that is often untrue.
Related Free Tools From Arb Digital
Count totals rather than runs with the coin flip probability calculator, generate real sequences with the coin flip simulator, model repeated trials with the binomial distribution calculator, build event probabilities from scratch with the probability calculator, or explore another counterintuitive result with the birthday paradox calculator. The full free online tools hub lists every probability tool we publish.
Frequently Asked Questions
Above 96 percent for a run of five of either side with a fair coin. Runs that feel remarkable are routine once the sequence is long enough, because there are many places a run could start.
Because two events are being allowed rather than one, and at moderate streak lengths a sequence can rarely contain both a long head run and a long tail run, so the probabilities nearly double.
That tool counts how many heads appear in total, using the binomial distribution, which ignores order entirely. A streak is purely about order, so it needs a recurrence over the sequence instead.
Yes. The figure is for a run of at least five, so a run of eight counts. A run of exactly five is a smaller number, because it also requires a different result on both sides.
Roughly the base-two logarithm of the number of tosses, a little above it. For a hundred fair tosses that is just under seven, and for a thousand just over ten.
Yes. Set the head probability to whatever you need. Runs of the more likely outcome lengthen sharply while runs of the less likely one become rare very quickly.
Rarely on its own. Compare the observed longest run with the figure this page gives for a fair coin, and if it falls inside the usual range then it is not evidence of anything.
No. That is the gambler's fallacy. Each toss is independent, so the next one is still an even chance whatever came before it.
This page explains a probability calculation for educational purposes. It assumes every trial is independent with a constant probability, which real performance data often violates, and nothing here is betting or investment advice.