← All tools

🪙 Flip a coin — heads or tails?

Can't decide? Let the coin decide instead. Press once for one toss, or a hundred for a run worth counting: the tally underneath keeps score of every flip this page has seen, runs and all.

How many flips?

The coin

Last flip
–
Flips
0
Heads
0
Tails
0
Longest run
–

Why flip a coin?

Some decisions are not worth the argument. Two options are equally fine, nobody will choose, and the discussing has started to cost more than the decision is worth — that is the moment for a coin. It settles the question in one motion, in front of whoever is there, and it does it without anybody having to be talked into anything: the coin decided, so nobody did.

There is a second use that people are slower to admit. A coin is very good at telling you which way you were hoping it would land: once it is in the air, most people know. If the answer disappoints you, that is information the argument was never going to give you.

How does this coin decide?

The side is drawn first, at random, and the coin is then turned to land on it:

side = heads if random() < 0.5, otherwise tails

  • Every flip is independent of every other one, so the coin has no memory: five heads in a row does not make tails any more likely on the next flip.
  • The coin is turned by whole half turns and the count of them only ever grows — an even number shows heads, an odd number shows tails — so it always turns the way round it was already going, instead of snapping from one face to the other.
  • A named run, from a given point, is the easy sum: five heads is 1 in 32, and ten is 1 in 1,024.
  • Asking whether a run turns up somewhere in a longer stretch is a different question and a much likelier one: five heads somewhere in a hundred flips happens about 81% of the time. That figure is counted here rather than looked up — every way of flipping a hundred coins without ever getting five in a row is added up and taken away from the total, which is the same working that makes the first five flips a 1-in-32 chance of being all heads.
  • A run of either side is likelier again: five in a row, heads or tails, somewhere in a hundred flips is close to certain.

The count under the coin is what actually happened, sitting next to what the arithmetic expects, which is half of them heads. A short run of flips wobbles a long way from half; the wobble shrinks as the count grows, which is the law of large numbers doing its slow work.

Frequently asked questions

Is it really random?

The side is drawn with the browser's own random number generator, which is the same source any ordinary online coin uses and is far better than the question usually deserves. It is not cryptographic randomness — nothing a browser can produce is — so treat it as fair rather than tamper-proof, and do not use it where somebody has both a reason to cheat and the means to.

Is the result decided before the coin lands?

Yes, and the page has not pretended otherwise: the side is drawn first and the coin is turned to show it. Spinning a coin and then reading which face came up would reach the same kind of answer, and this way round the coin can be given whole turns instead of stopping halfway through one.

I just got six heads in a row. Is the coin broken?

No. Six heads from a given point is 1 in 64, but a run has many places to start, and five in a row somewhere in a hundred flips turns up about 81% of the time. Runs are not a sign of a broken coin; they are what a fair coin does.

After five heads, is tails due?

No. The coin has no memory and nothing to catch up on: the next flip is a half chance each way whatever came before it. Expecting tails because heads have had a turn is the gambler's fallacy, and it is the most reliable way there is to lose an argument with a coin.

Why is my count not exactly half?

Because half is where it tends, not where it sits at every moment. Six heads out of ten is unremarkable, and a count can look badly wrong for a long time before it drifts back towards even; the drift is real, but it is a slope rather than a correction.

Does it remember anything between visits?

No. The count lives in the page you are looking at and nowhere else: nothing is saved on your device and nothing is sent anywhere, so closing the tab clears the tally. Every page on this site works that way.

Does it work without JavaScript?

No. The coin, the count and the figures in the working above are all written by the script, so with scripting turned off there is nothing to flip. This page and the wheel are the exceptions here — every other tool is arithmetic, and keeps working without it.

More calculators