Coin Toss
Flip a virtual coin and get heads or tails from your browser's cryptographic random generator, with a running tally of flips and percentages.
The interactive tool loads here when JavaScript runs.
About this toolWhat is Coin Toss?
Coin Toss flips one virtual coin per click. Press Flip Coin, watch a short 2.5 second spin, and the face shows a crown for heads or a squirrel for tails. Underneath, a Statistics card keeps count of total flips, heads and tails, with each side shown as a rounded percentage.
Each result is drawn with crypto.getRandomValues, the browser's cryptographically secure generator, and mapped to heads or tails with exactly equal probability. Nothing is sent anywhere and the tally lives only in the page, so Reset or a reload clears it.
The coin has no memory. Five tails in a row does not make heads more likely on the sixth flip.
- Fair 50/50 result from crypto.getRandomValues
- Running tally of flips, heads and tails with percentages
- Fullscreen mode on desktop for showing a room
- Runs entirely in your browser, no sign-up
Updated
How to use Coin Toss
- Click Flip Coin. The button is disabled while the coin spins so you cannot double-flip.
- Read the result on the coin face: the crown with HEADS or the squirrel with TAILS.
- Keep flipping to build up the Statistics card, which shows Total Flips and the heads and tails counts with percentages.
- Click Reset to clear the result and all counters, or use the expand button (desktop only) to show the coin full screen.
Worked example
Why 10 flips can look lopsided
Input
10 flips
Output
Heads 7 (70%), Tails 3 (30%)
A 7 to 3 split in ten flips happens about 34% of the time with a perfectly fair coin (counting 7 or more of either side). Percentages only settle near 50% after hundreds of flips, so a short streak says nothing about bias.
Background and insight
A real coin is less fair than people assume. In 2007 Persi Diaconis, Susan Holmes and Richard Montgomery modelled the physics of a flip and predicted that a coin caught in the hand lands on the side it started on about 51% of the time, because it precesses (wobbles) in the air. In 2023 František Bartoš and colleagues tested that with 350,757 flips by 48 people and measured a same-side rate of about 50.8%. Small, but real, and it varies from flipper to flipper.
A software coin avoids that physics but has its own trap. Many quick implementations use Math.random() < 0.5, which is fine for games but comes from a fast non-cryptographic generator (xorshift128+ in V8). This tool asks the operating system's CSPRNG for a random integer and uses rejection sampling to turn it into 0 or 1, so the mapping to heads or tails adds no bias of its own.
Common use cases
Settling a two-way tie
Pick which of two equally good options to try first, or who presents first at a demo.
Kick-off and serve
Decide which team starts in a casual match or board game when there is no physical coin around.
Teaching probability
Run 50 or 100 flips in class and watch the percentages drift toward 50% as the count grows.
Breaking decision paralysis
Assign heads and tails to two choices and notice which result you were hoping for.
Tips and limitations
- Agree on what heads and tails mean before you click, or the loser will ask for best of three.
- Percentages are rounded to whole numbers, so 1 heads in 3 flips shows 33% and the two sides can add up to 99% or 101%.
- Counters are not saved. Reloading the page or pressing Reset starts from zero.
- For more than two options use the Spin Wheel or Random Picker instead of chaining coin flips, which gets fiddly fast.
Sources and further reading
- Dynamical Bias in the Coin Toss, SIAM Review. Diaconis, Holmes and Montgomery, 2007
- Fair coins tend to land on the same side they started: Evidence from 350,757 flips, arXiv. Bartoš and colleagues, 2023
- Crypto: getRandomValues() method, MDN Web Docs. The browser CSPRNG the tool uses
- There's Math.random(), and then there's Math.random(), V8. Why V8 switched Math.random() to xorshift128+
Frequently asked questions
Is an online coin toss really 50/50?
This one is. Each flip draws a random integer from your browser's cryptographic generator and maps it to heads or tails with rejection sampling, so neither side is favoured by the mapping and previous flips have no influence on the next one.
Is a real coin flip fair?
Almost, but not quite. A 2023 experiment by Bartoš and colleagues with 350,757 hand-caught flips found coins land on the side they started on about 50.8% of the time, close to the 51% that Diaconis, Holmes and Montgomery predicted in 2007 from the physics of a wobbling coin.
Why did I get heads five times in a row?
Streaks are normal for a fair coin. Five heads in a row has a 1 in 32 chance from any starting point, and in 100 flips you will usually see a run of six or more of one side. The coin does not remember earlier results.
Does the coin toss keep a history of my flips?
It keeps a count, not a list. The Statistics card shows total flips and how many were heads and tails with percentages, and it lives only in the page, so pressing Reset or reloading clears it.
Can I use this virtual coin to make a binding decision?
It is as fair as any coin you could hold, but it has no audit trail. For anything with money or prizes attached, do the flip live on a shared screen so everyone sees the result at the same moment.
How do I flip a coin best of three online?
Click Flip Coin three times and read the Statistics card: whichever side has two or more wins. Press Reset first so earlier flips are not counted in the tally.
Is there an in-depth guide to Coin Toss?
Yes. “Fair Random Decisions: Coin Flips, Wheels, Shuffles and Even Groups” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.