Skip to main content
ponderloop

Flip a Coin

Choose how many coins to flip, from 1 to 1,000, and press Flip: every coin lands heads or tails with an exact 1 in 2 chance, and the page tallies the heads and tails (counts and percentages), the longest streak and how likely a streak that long is. The printed example below is not a real flip: its 20 fixed flips gave 11 heads, 9 tails (55.0% and 45.0%) with a longest streak of 4 tails in a row. In 20 fair flips, a streak of 4 or longer (of either side) happens 76.84% of the time. Each coin is one bit from your browser’s cryptographic random number generator, so heads and tails are exactly as likely, and nothing is sent anywhere.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

From 1 to 1,000 coins. Every coin is heads or tails with the same chance.

Your flips

Example result with 20 fixed flips, not a random one. Press Flip for a real one.

11 heads, 9 tails

Heads
11 55.0%
Tails
9 45.0%
Longest streak
4 tails in a row

In 20 fair flips, a streak of 4 or longer (of either side) happens 76.84% of the time.

Show the flips as text

HTTHHTHTTTTHHTHHHTHH

H is heads and T is tails, in the order flipped.

How likely is a streak?

The exact chance that a run of fair flips contains a streak of at least this many heads or this many tails in a row. The last row is the average length of the longest streak.
Streak of at least10 flips20 flips50 flips100 flips500 flips1,000 flips
3 in a row82.62%97.91%more than 99.99%more than 99.99%more than 99.99%more than 99.99%
4 in a row46.48%76.84%98.12%99.97%more than 99.99%more than 99.99%
5 in a row21.68%45.84%82.09%97.17%more than 99.99%more than 99.99%
6 in a row9.38%23.69%54.41%80.68%99.98%more than 99.99%
8 in a row1.56%5.44%16.20%31.48%86.31%98.17%
10 in a rowabout 1 in 5121.17%4.05%8.67%38.43%62.39%
15 in a rowimpossibleabout 1 in 4,681about 1 in 886about 1 in 3771.48%2.97%
20 in a rowimpossibleabout 1 in 524,288about 1 in 32,768about 1 in 12,788about 1 in 2,176about 1 in 1,068
Average longest streak3.74.76.07.09.310.3

How many heads to expect

The number of heads in n fair flips averages n ÷ 2 and strays by about √n ÷ 2 (the standard deviation). The last column is the exact chance of landing within two standard deviations of the average.
FlipsAverage headsStandard deviationWithin 2 standard deviationsChance of landing there
1051.582 to 8 heads97.85%
100505.0040 to 60 heads96.48%
1,00050015.81469 to 531 heads95.37%

Ten flips: the chance of each number of heads

There are 1,024 equally likely sequences of 10 flips. Exactly 5 heads is the most likely count, yet it happens in fewer than 1 in 4 runs.
HeadsWaysChance
01 of 1,024about 1 in 1,024
110 of 1,024about 1 in 102
245 of 1,0244.39%
3120 of 1,02411.72%
4210 of 1,02420.51%
5252 of 1,02424.61%
6210 of 1,02420.51%
7120 of 1,02411.72%
845 of 1,0244.39%
910 of 1,024about 1 in 102
101 of 1,024about 1 in 1,024

How to flip a coin online

  1. Choose how many coins. Type a number from 1 to 1,000 or press one of the quick buttons (1, 10, 100 or 1,000). One coin is a plain heads-or-tails decision; more coins make a tally.
  2. Press Flip. The coins appear in the order they landed (H for heads, T for tails) and the result is announced to screen readers. The short flip animation only plays when your device allows motion.
  3. Read the tally. Heads and tails are counted with their percentages, and the longest streak of the same side is shown with the exact chance of seeing a streak that long or longer in that many fair flips.
  4. Flip again or copy the result. Flip as often as you like: every flip is independent of the one before. Copy result puts the tally and the H/T sequence on your clipboard.

Frequently asked questions

Is the flip really 50/50?
Yes. Each coin is a single bit from your browser’s cryptographic random number generator (crypto.getRandomValues), and a bit is 1 or 0 with equal probability, so heads and tails are exactly equally likely with no rounding or modulo bias. The tool never uses Math.random.
Why do I get long streaks? Is something wrong?
No: streaks are normal. In 20 fair flips a streak of 4 or more happens 76.84% of the time, and in 100 flips a streak of 6 or more happens 80.68% of the time. The longest streak in 1,000 flips averages about 10.3. Truly random sequences look streakier than people expect.
If I get five heads in a row, is tails “due”?
No. Every flip is independent, so the next coin is still 1 in 2 whatever came before. Believing otherwise is the gambler’s fallacy. A long streak does not get “paid back”; it just becomes a smaller share of a longer run of flips.
How is the chance of the streak worked out?
By counting, not by simulation. The tool follows every possible sequence of fair flips at once, tracking how long the current run is, and adds up the probability of the run first reaching the observed length at some flip. The result is the exact chance that n fair flips contain a streak of that length or longer, of either heads or tails.
What does the streak chance tell me about my flips?
It is the chance, before flipping, of a streak at least as long as the one you got. A high figure means a streak like yours is ordinary; a small one, such as about 1 in a thousand, means it is rare for a fair coin, although with enough flips rare things do turn up.
Why is a result like 500 heads and 500 tails unlikely?
Because there are many other counts nearby. In 1,000 flips exactly 500 heads has a chance of only about 2.5%, and the number of heads usually lands within about 31 of 500 (two standard deviations, which covers 95.37% of results). The percentages get closer to 50% as you flip more, even though the gap in counts tends to grow.
Is a real coin toss exactly 50/50?
Very nearly. Careful studies of coins tossed by hand found a slight tendency, about 51%, for a coin to land the way it started. This page does not toss a physical coin, so it has no such bias: it is a fair 1 in 2 chance on every coin.
Why is the limit 1,000 coins?
So every coin can be shown and the whole sequence stays readable and copyable. 1,000 coins is plenty to see the share of heads settle near 50% and to watch streaks appear. For a decision, a single coin is all you need.
Are my flips saved or sent anywhere?
No. The flips exist only on this page and disappear when you reload it. Nothing is uploaded; if you allow analytics, the site only learns that Flip was pressed, never how many coins or what they showed.
Does it respect reduced motion?
Yes. The short flipping animation only plays when your device allows motion. With “reduce motion” turned on, the result simply appears, and it is announced politely to screen readers either way.

How it works

Each coin is one bit. The page asks the browser for random 32-bit words with crypto.getRandomValues and reads the bits of each word one by one: a 1 is heads and a 0 is tails. Because the range of a bit is a power of two, no value has to be thrown away and no modulo is used, so heads and tails are exactly equally likely and the coins are independent. Up to 1,000 coins come from 32 words. The tally counts heads and tails, shows each as a share of all flips (rounded to one decimal) and finds the longest run of the same side; if several runs tie, the first is shown. The chance of a streak is exact, not simulated. For n fair flips and a streak length L, the tool keeps the probability that no streak of L has happened yet and that the current run is k long, for each k below L; every new flip extends the run with probability 1/2 or starts a new one with probability 1/2, and the probability mass that reaches length L is added up as it first does. This covers streaks of either side together. The average longest streak is the sum, over every length L, of the chance that the longest streak reaches L. The number of heads in n flips is binomial: exactly k heads has probability C(n, k) ÷ 2^n, with mean n ÷ 2 and standard deviation √n ÷ 2. Percentages and chances are rounded only for display.

Sources

More: Random picks and gamesAll math & numbersAll toolsHome & DIY calculators