Coin Toss Streak Calculator
Find the probability that the longest run of heads in a sequence of fair, independent coin flips is exactly, at least, or at most a chosen length.
Experiment specifics
Results
Distribution of the longest head streak
Longest-run distribution table
| Longest head streak | Exact probability | At most this length |
|---|
How to use this coin toss streak calculator
What this calculator does
This calculator estimates the probability distribution of the longest consecutive run of heads in repeated flips of a fair coin. It answers questions such as “What is the chance of seeing at least three heads in a row in ten flips?” The model assumes independent flips and a 50% probability of heads on every flip. It measures the longest head streak, not the total number of heads, so order matters. A sequence such as HHTHH has four heads in total but its longest head streak is only two. For background on independent two-outcome trials, see Penn State's explanation of Bernoulli and binomial experiment conditions.
When to use it
Use the calculator when you want to quantify whether a visible run is unusual in a fair-coin experiment, compare different experiment lengths, study run-length probability for a class or simulation, or check a hand calculation involving consecutive heads. It is also useful for understanding why streaks can appear naturally even when flips are independent. It does not test whether a real coin is physically fair and it does not infer a coin's bias from observed data.
How to calculate
- The calculator opens with a ready-to-use demonstration: 10 flips, a streak length of 3, and the condition At least this length. The result and a validated example Excel workbook are available immediately.
- Replace Number of flips with the number of independent tosses in your experiment, then set Number of heads in streak to the run length you want to evaluate.
- Choose a Streak condition: exactly the chosen length, at least that length, or at most that length. The calculator updates live; no Calculate button is required.
- Use Result display to show the headline as a percentage, decimal, or exact fraction. Exact fractions are available when the flip count is below 30; larger cases remain available numerically as percentages and decimals.
- Read the headline probability, then use the distribution chart and table to see how probability is spread across every possible longest-run length. Select Download Excel to export the current inputs, outputs, and distribution as a real XLSX workbook.
- Reset clears the demonstration and all calculated state rather than restoring the example. After Reset, Download Excel is disabled until a complete valid input set is entered again.
Input guide
Number of flips is a required whole number from 1 through 500. Enter plain integer text such as 10; decimals, scientific notation, commas, signs, and unit words are rejected. More flips usually make longer streaks more likely. Number of heads in streak is also required and accepts a whole number from 0 through 500; 3 is a typical example. A streak length can exceed the number of flips, but then “exactly” and “at least” have probability zero while “at most” has probability one. Zero is meaningful: a longest head streak of zero means every flip was tails.
Streak condition is required and changes the event being measured. “Exactly this length” computes P(L = k), “At least this length” computes P(L ≥ k), and “At most this length” computes P(L ≤ k), where L is the longest head run and k is the chosen streak length. Result display is a presentation control: Percentage shows a percent, Decimal shows a value from 0 to 1, and Exact fraction shows a reduced rational probability when fewer than 30 flips are used. Changing the display does not change the underlying probability.
Output guide
Selected-event probability is the primary result for the chosen condition. It is an exact model probability for fair independent flips, displayed according to the Result display control. Decimal probability gives the same probability on a 0-to-1 scale. Exact fraction gives a reduced fraction when available; for 30 or more flips the interface reports that the exact fraction is not displayed. Complement probability is 1 minus the selected-event probability and represents all outcomes outside the chosen event.
The Longest-run distribution table has three columns. Longest head streak is the possible value r of the longest run. Exact probability is P(L = r). At most this length is the cumulative probability P(L ≤ r). The chart plots the same Exact probability series against r, so its line and the table are two views of identical model data. The distribution is shown for up to 100 flips to keep the visualization readable.
Worked example
With the startup values n = 10 flips and k = 3 heads, the selected event is “longest head streak is at least 3.” The complement is the event that no run exceeds 2 heads. There are 504 ten-flip sequences whose longest run is at most 2, out of 210 = 1,024 equally likely sequences. Therefore P(L ≥ 3) = 1 – 504/1,024 = 520/1,024 = 65/128 = 0.5078125 = 50.78125%. Those values match the first-open controls, result cards, distribution data, and exported workbook. For another treatment of the longest-run random variable in coin flips, Stanford's probability materials include a worked longest-sequence-of-heads problem.
How the longest-run probability is calculated
Let f(k, n) be the number of length-n head/tail sequences whose longest run of heads is at most k. For n no larger than k, every sequence qualifies, so f(k, n) = 2n. Beyond that point, qualifying sequences can be grouped by the position of the first tail: T, HT, HHT, and so on through k heads followed by T. This gives the recurrence below.
The cumulative probability is P(L ≤ k) = f(k, n) / 2n. From that one quantity, the other event types follow directly: P(L ≥ k) = 1 – P(L ≤ k – 1), and P(L = k) = P(L ≤ k) – P(L ≤ k – 1). This recurrence is related to generalized Fibonacci sequences. MathWorld's reference on runs in Bernoulli trials discusses run probabilities and related formulas.
How should you interpret a streak?
A long run may feel surprising, but independent random trials naturally form clusters. The key question is not whether a streak “looks patterned,” but how often a streak at least that long would occur under the assumed model. Increasing the number of flips gives more opportunities for a run to occur, so the probability of reaching a fixed threshold generally rises with n. Raising the required streak length makes the event more demanding, so the probability of reaching that threshold generally falls.
Do not confuse run probability with the binomial probability of getting a certain total number of heads. The binomial count ignores order; a streak statistic is entirely about order. A 10-flip sequence can contain five heads yet never contain three consecutive heads. For a standard introduction to fair-coin Bernoulli trials and fixed-trial experiments, OpenStax gives a concise coin-flip example within the binomial model.