U.UtilityApp
🔢 MathFree · No signup

Coin Flip — Heads or Tails

Flip a virtual coin and get heads or tails instantly — with a history of your last flips.

🪙

How each flip is decided

When you press Flip the coin, the page asks your browser's built-in cryptographic random generator (crypto.getRandomValues) for one 32-bit number. An even number is heads and an odd number is tails. Of the 4,294,967,296 possible values, exactly half are even, so the split is precisely 50/50, not just close to it.

The result is fixed the moment you click. For about 0.7 seconds the panel flickers between HEADS and TAILS and the button is disabled, but the flicker is decoration. It can't change the outcome, and clicking at a particular instant gives you no edge.

Each flip forgets the last one

No flip looks at earlier results. After five tails in a row, the next flip is still 50/50. The feeling that heads is due is the gambler's fallacy, and an independent random source is exactly where it doesn't hold.

Streaks are also more common than most people expect. Over 10 flips:

  • a run of at least three identical results somewhere in the sequence has an 82.62% chance;
  • a run of at least four has a 46.48% chance;
  • an exact five-and-five split happens only 24.61% of the time (252 of the 1,024 equally likely sequences).

Over 100 flips, the number of heads lands between 40 and 60 about 96.48% of the time, yet exactly 50 heads comes up only 7.96% of the time. A streak in your history is normal, not a sign that something is off.

Reading the history line

The large panel shows the latest result. Once you have flipped at least twice, a History line appears under the button with earlier flips, newest first. The tool keeps your last 12 flips, so you see the current one plus up to 11 before it.

The history exists only in the open tab. Reload or close the page and it starts empty, and none of it is sent anywhere. If you are running a probability exercise in class, tally the results on paper as you go.

Using a flip to settle something

  • Make the call before the flip. Agree out loud who has heads before anyone presses the button. Deciding afterwards invites an argument.
  • Best of three is no fairer than one flip. Each side still wins the series exactly half the time. It only takes longer, which can be the point if you want a bit of drama.
  • Three people can't share one flip evenly. Flip twice instead: give HH, HT and TH to the three people, and flip both again on TT. Each person then has exactly a one-in-three chance.

Frequently asked questions

Is an online coin flip as fair as tossing a real coin?+

It is at least as fair. A physical toss depends on the coin, the throw and the catch, which can in principle favor one side. Here nothing about how or when you click affects the result, and both sides have exactly equal odds on every press.

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

1 in 1,024, or about 0.098%. Each flip halves the chance, so 5 in a row is 1 in 32 and 20 in a row is 1 in 1,048,576. Any specific sequence of 10 flips, such as alternating heads and tails, is exactly as unlikely.

Can the coin land on its edge?+

No. The only outcomes are heads and tails. If you want a third option, such as a re-flip or a draw, the yes-or-no wheel with Maybe switched on gives three equally likely answers.

Embed this tool on your website

Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.

<iframe src="https://utilityapp.lat/embed/math/coin-flip" title="Coin Flip — Heads or Tails" width="100%" height="600" style="border:0;max-width:760px" loading="lazy"></iframe>
<p style="font-size:13px"><a href="https://utilityapp.lat/math/coin-flip">Coin Flip — Heads or Tails</a> by UtilityApp</p>