gizmobench

Coin Flip Simulator

Flip one coin, or throw a hundred at once and watch the tally. Every flip is a draw from crypto.getRandomValues, the browser's own cryptographic generator, mapped onto the two faces so that neither is favoured, which makes heads and tails exactly as likely as each other on every throw. The tally counts heads, tails, the heads share to a tenth of a percent and the longest run of one face, and it is kept in this browser so it survives a reload. Up to 1000 coins go in a single press, the last 20 flips are listed in the order they landed, and Best of plays a series one round at a time until a side takes the majority. Nothing is uploaded and no account is needed.

Ready
No flips yet. Press Flip to throw the first coin.
Mode
Coins a flip
Heads
0
Tails
0
Heads share
0.0%
Longest run
none yet
Flips
0

Press Space to flip without reaching for the mouse. The count field takes any number of coins from 1 to 1000 in one throw, and pressing Flip again adds to the same tally, so the session itself has no ceiling. Best of plays one flip a round until a side takes the majority, which is why the round count has to be odd.

The spin decides nothing. Every flip is drawn from crypto.getRandomValues, the browser's own cryptographic generator, the moment you press Flip, and the coin then turns to show a result that is already settled. The draw is mapped onto the two faces by rejection sampling rather than a remainder, so neither face is favoured, and no flip is influenced by the flips before it: a run of five heads leaves the next flip at 50 to 50. The tally is there so you can watch that happen rather than take our word for it.
Accuracy. A fair 50 to 50 draw from the browser's own cryptographic randomness, never a pattern or a seed. It cannot know anything about the decision you are making with it.

Common questions

Is the flip actually random?
Yes. Each flip is one 32-bit value from crypto.getRandomValues, the cryptographic generator built into your browser, mapped onto the two faces without a thumb on the scale: a draw that would favour one face is thrown away and taken again rather than folded back in with a remainder, which is what hands the first face an extra chance whenever the faces do not divide the range evenly. Over two faces the split is already exact, because 2 to the power 32 is even, so nothing ever has to be thrown away here; the guard is what makes the fairness a property of the code rather than a coincidence. There is no seed, no stored pattern and no server: one flip has no effect on the next, and a run of five heads leaves the sixth flip at 50 to 50. The tally under the coin is there so you can watch the share settle towards a half rather than take the claim on trust.
Can it flip more than one coin at a time?
Yes. The count field takes any whole number from 1 to 1000, with one-press buttons for 1, 10 and 100, and every coin in the throw is its own independent draw. Pressing Flip again adds the new coins to the same tally, so the session itself has no ceiling: three presses of 100 give a tally of 300. The 1000 limit is on one throw only, and it is there so a mistyped number cannot lock up the tab.
What does the longest streak mean?
It is the longest unbroken run of one face in this session, counted across every throw rather than within one of them. Runs are ordinary: in 100 fair flips a run of six is more likely than not, which is exactly why the number is on the page. It describes what has already happened and predicts nothing, because the coin has no memory. When two runs tie for the longest, the one that got there first keeps the record.
Is any of this saved?
The running tally is remembered in this browser, and nothing else. The two counts and the longest run are stored under a single key on your own device so the tally survives a reload, and the share and the total are worked out again from the counts when the page opens, so an edited record cannot make the page show a figure that contradicts itself. The individual flips are not stored at all: the last 20 on screen and the recent throws in the log go when you close the page. Reset tally clears the stored count in one press. Nothing is uploaded, there is no account, and no server ever sees a flip.
Can two people use it to settle something?
Yes, and the honest way to do it is to agree who has which face before the coin is thrown, because the tool does not take that as an input: it flips, and it reports. Both faces are equally likely on every flip, the result is drawn before the coin starts turning, and how long you watch the animation cannot change it. For a series rather than a single call, switch to Best of and play three, five or seven rounds; the round count has to be odd so the series cannot end level.
Does the animation change the result?
No. The flip is drawn the moment you press the button, and the coin then turns to show a result that is already settled. If your system asks for reduced motion the turn is dropped and the face simply swaps, which changes nothing about the draw. The same is true of the tally and the history strip: both are read from results that already exist.

A fair 50 to 50 draw from the browser's own cryptographic randomness, never a pattern or a seed. It cannot know anything about the decision you are making with it.