One coin, two outcomes
The page shows a coin, a Flip Coin button and a pair of counters. Clicking the coin itself does the same as clicking the button. Each press draws a random number and calls heads when it falls below 0.5, so the two outcomes are equally likely by design. The disc shows H on yellow for heads and T on grey for tails, and the matching counter climbs by one.
A worked example
Ten flips have 1,024 possible sequences. The tidiest split, five heads and five tails, accounts for 252 of them, or 24.6%, so an even result is the likeliest single pattern and still a minority of runs. Eight or more heads covers 56 sequences, 5.5%. Ten heads is 1 in 1,024, about 0.1%. Three heads in a row is unremarkable at 12.5%.
What the counters mean
Heads and tails are plain integers held in the page. They start at zero on every load, so a long session cannot be resumed, and there is no way to clear them other than reloading. The counters are updated on every flip, including flips started by clicking the coin rather than the button.
Where it stops
- The randomness comes from the browser's Math.random, which suits a game and is unsuitable where numbers must be unpredictable.
- No reset button and no history of earlier flips.
- One flip per press: no batch of ten and no seed, so a sequence cannot be replayed.
- Text output only; the coin does not animate or spin.
Questions people ask
Is the coin actually fair?
In principle yes. Over 1,000 flips the expected count is 500 heads, and a gap of twenty or thirty either way is ordinary variation rather than proof of bias.
Can several coins be flipped at once?
Not here. For a set of throws with a running total, use the dice roller; for a single integer in a range, the random number generator; to draw from a list of names, the wheel of names.