Coin Flip Simulator: Flip One Coin or Thousands
Choose how many times to flip and press Flip. You get the heads and tails counts, the longest streaks and the whole sequence, with an optional weighted coin.
Sequence (H = heads, T = tails)
Share of heads as the flips add up
This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.
A coin you can flip 100,000 times
A coin toss is the classic way to settle a small decision fairly, and it is also the simplest random experiment there is. This simulator does both jobs. Press the 1 flip button and it answers heads or tails. Raise the count and it becomes a small probability lab: it tallies the results, measures the longest streaks, prints the sequence and shows how the share of heads drifts toward one half as the flips pile up.
A hundred flips of a real coin takes several minutes and somebody has to keep score. Here it takes one click, which leaves the time for looking at what randomness really produces.
How to run a set of flips
- Tap a Quick pick button, or type a value in Number of flips (1 to 100,000).
- Leave Chance of heads (%) at 50 for a fair coin. Change it to model a weighted coin or any yes-or-no event with a known chance.
- Leave Seed (optional) empty for a fresh random result. Type a whole number if you need the same flips again later.
- Press Flip. Press it again for a new set.
- Read the counts in the navy panel, the percentages and streaks in the tiles, and the full run of H and T letters underneath (shown for up to 500 flips).
- Copy result copies the sequence or a summary. Reset returns to 100 fair flips.
Worked example with a seed
Random results differ every time, so an example needs a seed to be repeatable. Set the number of flips to 100, keep the chance at 50, type 42 in the seed box and press Flip. You will always get the same outcome:
- 50 heads, 50 tails, which happens to match the expected count exactly.
- The sequence starts HTTTTHHTTH.
- The longest run of heads is 6 and the longest run of tails is 7.
- There are 49 runs, meaning the result switched sides 48 times.
The rows below the tiles add context. The expected number of heads is 100 × 0.5 = 50, with a standard deviation of 5. The chance of landing on exactly 50 heads in 100 flips is only 7.95892%, so a perfect split is the most likely single result and still an uncommon one.
Change the seed to 7 and the flips to 10 and you get HTHHTHHHTH: 7 heads and 3 tails. That is 2 heads above the expected 5, or 1.26491 standard deviations, a perfectly ordinary gap for so few flips.
What the numbers mean
Expected count and standard deviation
For n flips with a chance p of heads, the expected number of heads is n x p and the standard deviation of that count is sqrt(n x p x (1 - p)). For a fair coin that is half the square root of n. Results within two standard deviations of the expected count are routine. With 100 fair flips that band is 40 to 60 heads, and the count lands inside it roughly 96 times in 100.
Runs and streaks
A run is a stretch of identical results in a row. People asked to write down a made-up sequence of coin flips tend to switch sides too often and avoid long streaks, because streaks feel unrandom. Real sequences are streakier than intuition says: in 100 fair flips, a run of five or six of the same side is normal, not a sign of a broken coin.
The settling table
The last table tracks the share of heads after 10, 50, 100 flips and so on. Early on the share can sit far from 50%. As the count grows it closes in. This is the law of large numbers, and the table lets you watch it happen.
| Fair flips | Expected heads | Standard deviation | Usual range (about 2 SD) |
|---|---|---|---|
| 10 | 5 | 1.58114 | 2 to 8 |
| 100 | 50 | 5 | 40 to 60 |
| 10,000 | 5,000 | 50 | 4,900 to 5,100 |
Notice what the table says and does not say. The share of heads gets closer to 50%, but the count can wander further from the exact half as n grows: 60 extra heads would be astonishing in 100 flips and unremarkable in 10,000.
How the randomness is made
Without a seed, each flip draws on your browser’s cryptographic random number source when one is available, and falls back to the standard random function if not. Nothing is sent anywhere; the flips happen on your device. Each flip is independent of the ones before it.
With a seed, the page switches to a small repeatable generator so that the same seed, flip count and chance always give the same sequence. Seeded results are good for worksheets and for checking work, but they are predictable by design, so do not use a seed when the outcome matters to someone.
Misreadings to avoid
- The gambler’s fallacy. After five tails in a row, heads is not due. The coin has no memory, and the next flip is still 50-50.
- Expecting an exact split. Ten flips come out exactly 5 and 5 only about a quarter of the time (24.6094%).
- Reading too much into a small sample. Seven heads in ten flips says almost nothing about whether a coin is fair. Thousands of flips are needed to detect a small bias.
- Treating it as a physical coin. This is a mathematical model with an exact chance of heads. Real coins and real tosses can have tiny quirks the model ignores.
A virtual coin is fine for picking who goes first or which topic to revise. For anything with real stakes, agree on the method with everyone involved before you flip.
Classroom and study ideas
Human versus machine. Have half the class invent a sequence of 50 flips on paper while the other half records real or simulated ones. Compare the longest runs. The invented lists often give themselves away by having no long streaks.
Watching the law of large numbers. Run 10 flips several times and note how much the heads percentage jumps around. Repeat with 1,000 and then 100,000. Students see the swings shrink without needing a formula first.
Weighted events. Set the chance of heads to 25 to stand in for guessing on a four-option multiple-choice question, and flip 20 times to simulate one student guessing through a 20-question quiz. Then compare the simulated scores with the exact probabilities from the binomial distribution calculator, or work out single-event odds in the probability calculator.
When a decision has more than two options, a coin is the wrong tool. The random number generator picks from any range, the random name picker draws a student from a list, and the yes or no picker gives a quick answer with a bit more ceremony. You will find them and other math calculators in the main collection of free online tools.
Frequently asked questions
Is this coin flip really random?
Yes for practical purposes. Without a seed each flip uses the random number source built into your browser, the cryptographic one when available, and every flip is independent of the last. With a seed the result is repeatable on purpose.
What are the odds of getting exactly 50 heads in 100 flips?
About 7.96 percent (0.0795892). An exact 50-50 split is the single most likely outcome, but some other count turns up about 92 times in 100.
If I get five tails in a row, is heads more likely next?
No. Each flip of a fair coin is independent, so the chance of heads is still 50 percent. Believing a result is due is known as the gambler’s fallacy.
How many heads should I expect in 100 flips?
The expected count is 50, with a standard deviation of 5. Anything from about 40 to 60 heads is an ordinary result for a fair coin.
What does the seed do?
A seed makes the result repeatable. The same seed with the same number of flips and the same chance of heads always produces the same sequence, which is useful for worksheets and for checking an example. For example, seed 42 with 100 fair flips always gives 50 heads.
Can I flip a weighted or biased coin?
Yes. Change the chance of heads from 50 to any percent from 0 to 100. Setting it to 25, for example, models an event that happens one time in four.
