Skip to content
ZeroServer.tools

Flip a Coin

Flip a fair coin, or up to 10,000 at once: heads or tails, best of 3, 5 or 7, and a name of your own for each side. The tally counts every toss and its longest run, and says how often a fair coin does as much. Nothing leaves this tab.

Press Flip, the coin or Space.

Coins
Best of

One coin: Heads or Tails, 1 in 2 each.

Your flips

Every toss is counted here, with its runs, until you leave or press Reset.

Check a real coin

Toss a coin of your own many times, count, and type in its heads and tails: the page says how often a fair coin splits at least that unevenly.

How the coin is flipped

Each coin is the top bit of a 32-bit number from crypto.getRandomValues(), the generator browsers keep for encryption keys. Exactly half of all such numbers have that bit set, so heads and tails each have a chance of 1 in 2, and no toss depends on the one before it. The side is drawn first; the coin's turn on screen is only how it is shown.

A real coin comes close. In 350,757 tosses collected by František Bartoš and colleagues, heads came up 50.0% of the time, but a coin landed on the side it started on 50.8% of the time, as a model by Diaconis, Holmes and Montgomery had predicted in 2007. Runs surprise people more than the split does: in 100 fair tosses a run of 7 or more of the same side comes up more often than not. For more than two options, spin the wheel; for numbers, use the random number generator.

What this tool is used for

  • Settling a choice between two options, such as who goes first in a game or which film to watch, with a name of your own on each side.
  • Starting a match the fair way: one toss for the kick-off or the first serve, or best of 3 when one toss feels too final.
  • Teaching probability: flip 100 or 10,000 coins, watch the share of heads settle near 50%, and see how long the runs of one side really get.
  • Checking a real coin, or a classroom experiment, by typing in its heads and tails and reading the exact binomial test.
  • Making many yes-or-no picks at once, such as 20 coins for 20 rows of a game or an experiment, each drawn on its own.

How it works in practice

A worked example

A student tosses a real coin 100 times for a statistics class, counts 61 heads and 39 tails, and checks whether the coin is fair.

Input
Check a real coin
Heads: 61
Tails: 39
Output
Heads 61, Tails 39: 61.0% heads in 100 tosses.
100 tosses of a fair coin split at least this unevenly 3.52% of the time (the exact binomial test, two-sided).
Unusual for a fair coin: fewer than 1 in 20 fair runs split this unevenly.
The coin's chance of heads is likely between 51.2% and 70.0% (Wilson's 95% interval).

A fair coin gives 50 heads in 100 tosses on average, and 61 is 11 more. The test adds up the chance of every split at least that uneven, 61 or more of either side: 3.52%, under the usual cut of 5%, so the result is called unusual. That is not proof of a bent coin: in a class of 30 students tossing fair coins, about one would see a split this uneven. Wilson's interval, 51.2% to 70.0%, leaves 50% just outside it.

The edge case that catches people

Few tosses say little, however lopsided: 8 heads and 2 tails comes up 10.9% of the time with a fair coin, nothing unusual, and Wilson's interval runs from 49.0% to 94.3%. A small bias needs many tosses: a coin that gives 51% heads needs about 10,000 of them before the interval leaves 50% out.

When not to use this tool

It is not for a draw with a prize, or anything others must be able to check: a toss on one person's device proves nothing to anyone else. Nor is it for a choice that deserves thought. For more than two options use spin the wheel or the random number generator, and for one yes or no on a wheel, the yes or no wheel.

Frequently Asked Questions

Is this coin flip really 50/50?
Yes. Each coin is the top bit of a 32-bit number from crypto.getRandomValues(), the browser's generator for encryption keys, and exactly half of all such numbers have that bit set. So heads and tails each have a chance of exactly 1 in 2; the coin's turn on screen is planned after the side is drawn.
Is a real coin toss 50/50?
Almost. In 350,757 tosses collected by František Bartoš and colleagues, heads came up 50.0% of the time, but a coin landed on the side it started on 50.8% of the time, as a model by Diaconis, Holmes and Montgomery had predicted in 2007. This page's coin does not depend on the side it shows before a flip.
How many heads in a row is unusual?
Fewer than most people think is normal. In 100 tosses of a fair coin, a run of 7 or more of the same side comes up 54.2% of the time, and one of 10 or more 8.67% of the time. The tally shows, for your own flips, how often a fair coin's tosses hold a run as long as your longest.
How do I flip several coins at once?
Choose how many under Coins, from 2 to 10,000. Each coin is drawn on its own, up to 100 are shown one by one, and the result counts each side. Every coin goes into the tally in the order it was drawn, so its runs carry on from one flip to the next.
What does best of 3 do?
It flips one coin at a time until a side has more than half: 2 of 3, 3 of 5 or 4 of 7. The page shows each toss of the series and its winner, such as Heads wins 2–1, and the series' tosses go into the tally like any others.
Can I rename heads and tails?
Yes: give each side a name of up to 30 characters, such as Pizza and Tacos, and the coin, the result and the history use them. The names and your choices are kept in the page's address after #, which browsers never send to a server, so Copy link takes them to whoever you send it to.
How can I tell if my own coin is fair?
Toss it many times, count, and type the heads and tails under Check a real coin. You get the exact binomial test and Wilson's 95% interval for its chance of heads. With 100 tosses that interval is about 20 points wide, so a small bias needs thousands of tosses to show.
Is anything sent or kept?
No. The coins are drawn in your browser, and the tally stays in this tab until you leave or press Reset; nothing is sent or stored. Only the names and the choices are kept, in the page's address after #, which browsers never send to any server.

Common errors and gotchas

  • Flipping again because the first result was not the one wanted, which turns a random choice back into a decision.
  • Reading a run of 5 or 6 heads as a sign that something is wrong: in 100 tosses of a fair coin, a run of 6 or more of the same side comes up 80.7% of the time.
  • Expecting tails to be due after several heads: each toss has the same chance of 1 in 2, whatever came before it.
  • Judging a real coin from 10 or 20 tosses: even 8 heads in 10 is nothing unusual for a fair coin, which splits at least that unevenly 10.9% of the time.
  • Giving both sides the same name, so that a result cannot be told apart; the page warns when the two names read the same.

Related Generators tools

Private & free — this tool runs entirely in your browser.

Cloudways — Managed cloud hosting on AWS, GCP & DO — from $11/mo.affiliate