Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Coin flip

Flip a fair virtual coin once or up to a million times. See the tally, the longest streak, and how your result compares with 50/50.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Need more than two outcomes? Roll with the dice roller or pick from any range with the random number generator. Want the exact odds of k heads? Use the probability calculator.

What this coin flipper does

It tosses a fair virtual coin up to a million times and counts the results. You get the heads and tails tally, the longest streak, and how far the result is from a perfect 50/50 split. It's handy for settling a choice, running a classroom probability experiment, or seeing how real randomness behaves.

How the flips are made

Each flip is one bit from your browser's cryptographic random generator (crypto.getRandomValues). A random bit is 0 or 1 with equal chance, so heads and tails are exactly 50/50. Because there are exactly two outcomes, no rejection step is needed: a 32-bit value splits evenly into 32 fair flips, with no modulo bias.

The comparison with 50% uses the binomial distribution. For n fair flips:

expected heads = n × 0.5  ·  standard deviation = √(n × 0.5 × 0.5) = √n ÷ 2

The chance of a result at least as far from 50/50 as yours is the exact two-sided binomial probability, added up term by term. The chance of a streak at least as long as yours is counted exactly too, using the number of flip sequences in which every run is shorter.

Worked example

Flip 100 times. You'd expect 50 heads, with a standard deviation of √100 ÷ 2 = 5. So 45 to 55 heads is an ordinary result: about 73% of the time you'll land in that range. Getting 60 heads is 2 standard deviations away. The chance of being 10 or more heads away from 50, in either direction, is about 5.7%: unusual, but it happens.

More flips, closer to 50%

The count of heads wanders further from n ÷ 2 as you flip more, but the percentage gets closer to 50%. That's the law of large numbers.

FlipsExpected headsTypical spread (1 SD)Spread as a share
105±1.5815.81 points
10050±5.005.00 points
1,000500±15.811.58 points
10,0005,000±50.000.50 points
100,00050,000±158.110.16 points
1,000,000500,000±500.000.05 points

Streaks are longer than people expect

In n flips, the longest run of either heads or tails is typically about log₂(n) long. That's about 7 for 100 flips and about 10 for 1,000 flips. Mark Schilling's analysis found that 63% of sequences of 250 fair tosses contain a run of at least 8 heads or 8 tails. If a "random" list someone wrote by hand has no long streaks, it probably wasn't random.

Limitations

  • This is a fair virtual coin. A real coin can be very slightly biased by how it's tossed and caught.
  • Up to 1,000,000 flips at a time. The flip-by-flip sequence is shown for 100 flips or fewer.
  • Each press of Flip again is a fresh, independent set of flips. Nothing is saved.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • 10 flips: an exact 5–5 split has a 252/1,024 = 24.61% chance ✓
  • 1,000 flips: expected 500 heads, give or take √1,000 ÷ 2 = 15.81 ✓
  • 1,000 flips: an exact 500–500 split has a 2.52% chance ✓
  • 1,000,000 flips: expected 500,000 heads ± 500 ✓
  • Edge: 0 flips asks for at least 1 ✓
  • Edge: 1,000,001 flips is over the limit ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

Is an online coin flip really 50/50?

This one is. Each flip is a bit from your device's cryptographic random generator, which is designed so 0 and 1 are equally likely and unpredictable.

What are the odds of getting heads 10 times in a row?

For a given set of 10 flips, (1/2)^10 = 1 in 1,024. Over a long series of flips, though, a streak of 10 somewhere becomes likely: in 1,000 flips the longest streak is usually around 10.

If I flip a coin 100 times, how many heads should I get?

50 on average, but anywhere from 40 to 60 is normal. The standard deviation is 5, and about 96% of the time the count lands between 40 and 60.

Does a coin 'remember' the last flip?

No. After five heads in a row, the next flip is still 50/50. Believing tails is 'due' is called the gambler's fallacy.

Related calculators