Coin Flip
Flip 1 or many coins. Cryptographically random.
Overview
The Coin Flip tool simulates one or many coin tosses using a cryptographically secure random source. It returns a clear sequence of heads and tails along with a tally so you can see the running ratio at a glance, making it useful for everything from settling a quick decision to demonstrating probability in a classroom.
The tool is aimed at teachers running probability lessons, board-gamers without a coin handy and developers needing a quick fair-choice helper. Common long-tail queries like "random coin flip many times", "cryptographic coin toss generator" and "fair heads or tails for tournaments" all land here.
How it works
A standard pseudo-random generator would be fine for casual use, but for fairness across many flips the tool draws bytes from the operating system's cryptographic source — RandomNumberGenerator on .NET, which wraps the OS CSPRNG (BCryptGenRandom on Windows, getrandom on Linux). Each flip consumes one byte, and the result is heads if the byte's least-significant bit is zero, tails otherwise. Using a single bit per flip avoids any modulo bias.
For batch flips, the tool draws a buffer of N bytes in one call and decodes them in order. The running tally is computed by counting matches as it goes, so a thousand flips still complete instantly. The cryptographic source guarantees independence — earlier flips do not influence later ones — which is what makes the long-run ratio approach 50/50 as expected.
Examples
Flips: 1 → H
Flips: 5 → H, T, T, H, T (Heads: 2, Tails: 3)
Flips: 20 → HTHHTTHTHHTHTTHHTHTT (Heads: 10, Tails: 10)
Flips: 100 → ratio settles around 47-53 heads on most runs
FAQ
Is the coin really 50/50?
Each flip is independent and unbiased to within the resolution of a single random bit. Short runs will deviate from exactly half — that is normal variance, not bias.
Can I save the results?
Copy the output to the clipboard, paste it into a spreadsheet, or screenshot the tally. The tool does not persist results across page reloads.
Why does the long-run ratio still look uneven?
The expected standard deviation for N flips is roughly the square root of N divided by 2. For 100 flips, deviations of plus or minus 5 from 50/50 are common.
Is this suitable for tournament tiebreaks?
Yes. The cryptographic source removes any pattern that a clever observer could exploit, so it is fair for high-stakes choices like seeding or coin-toss overtime.
Does it work offline?
The flip happens in the browser process and does not require a network round-trip after the page has loaded.