Coin Flip
Heads or tails, settled. Flip many at once and it also shows the longest streak — the thing people are most likely to mistake for a rigged coin.
How to use it
- Leave it at one flip to settle an argument.
- Or ask for a hundred, or ten thousand, to see how a fair coin actually behaves over a run.
The streak is the interesting number
Flip a coin a hundred times and you will almost certainly get six or seven of the same side in a row somewhere. People see that and conclude the coin is loaded, or that the generator is broken. It is neither. Long streaks are not a flaw in randomness; they are a requirement of it.
A rough rule: in n flips, the longest streak tends to be about as long as the number of times you can halve n before reaching one. A hundred flips, about six or seven. A thousand flips, about ten. This page prints what is typical next to what you actually got, so you can see whether your run was unusual or ordinary.
The opposite mistake is more common still. After five heads, a tail is not more likely. The coin has no memory of the five flips and no obligation to even things up. That belief is old enough to have a name — the gambler's fallacy — and it is what casinos are built on.
A digital coin is fairer than a real one
A real coin flip is not quite 50–50. Research into how coins actually tumble found that a flipped coin lands on the same face it started from about 51% of the time, because the coin wobbles around an axis rather than turning cleanly end over end. A very large study of hundreds of thousands of real flips found the same small bias.
Spinning a coin on a table is far worse: the slightly heavier rim on one side can push it well away from even. So if you want an honestly fair coin, a page like this beats the thing in your pocket. Both are fine for choosing who goes first.
Where the randomness comes from
Every flip comes from crypto.getRandomValues, the
generator your browser uses for encryption keys, and each random
number it hands over supplies thirty-two flips — one per bit.
There is no bias to correct here, because two divides evenly into the
generator's range. That is not true for a six-sided die, which is
why the dice page has to work a little harder.
Frequently asked questions
Is this really 50-50?
Yes. Each flip is one bit straight from your browser's cryptographic generator, and two divides evenly into its range, so neither side is favoured by even a fraction. An actual metal coin is measurably less fair than this.
I got eight heads in a row. Is it broken?
Almost certainly not. In a few hundred flips a streak of eight is unremarkable. The page prints the typical streak length for the number of flips you asked for, so you can compare rather than guess.
After several heads, is a tail more likely?
No. The next flip is 50-50 no matter what came before, because nothing about the coin or the generator remembers the earlier flips. Expecting a correction is the gambler's fallacy.
Can I use it to decide something important?
For anything contested, flip once and record your screen. The randomness is sound, but a web page cannot prove to another person that you did not keep flipping until you liked the answer.
Why is the sequence hidden for a single flip?
Because a one-character sequence tells you nothing you cannot already see in the big result. It appears as soon as you ask for more than one flip.
Is my text sent anywhere?
No. Everything happens in JavaScript inside your own browser. Nothing is uploaded and nothing is saved - close the tab and it is gone.