Flip a Coin
A free coin flipper: heads or tails with a 3D coin, 1 to 100 coins at once, streaks, your own words on each side and a fair draw anyone can verify.
Tap the button, or press Space.
Make it yours
Try “Pizza” and “Tacos” to decide dinner. The coin is a generic design, never a real currency.
Shows a fingerprint of the settings before the draw and the secret seed after it, so anyone can re-run it and check the result.
Verify someone else's draw
Paste what was published: the settings exactly as shown, the revealed seed and the commitment hash. The panel recomputes both.
Fair draw shows the result follows from the seed and settings. It does not stop someone from privately trying several seeds before publishing one, so for something that matters, publish the commitment first where others can see its time. How we test randomness
- Verified: fair odds and exact landing tested on every release
- Last reviewed:
- Runs in your browser: nothing is uploaded
- Found an error?
How to flip a coin online
- Step 1
Flip
Tap the button or press Space. The result is decided first by your browser's secure random number generator, then the coin spins to land on exactly that side.
- Step 2
Flip many
Set Coins to anything from 1 to 100 to flip them all at once. You get the totals, your longest streak this session and a chart of the heads share settling toward 50%.
- Step 3
Make it yours
Rename the sides (Pizza and Tacos, You and Me), pick a coin style, turn on sound, go fullscreen for a classroom or turn on Fair draw to publish a verifiable result.
Ways to use a coin flip
Decisions
- Rename the sides to the two options and flip.
- Settle who goes first, who pays or who picks the movie.
- Use Fair draw when the people involved are not in the same room.
Sport and games
- Choose ends or kick-off with a coin toss everybody can see on one screen.
- Run best-of-three or best-of-five by flipping three or five coins at once.
- Go fullscreen so the whole room sees the result.
Classroom probability
- Flip 100 coins and compare the share of heads with 50%.
- Watch the chart: short runs wander, long runs settle.
- Ask what the longest streak in 20 flips usually looks like, then test it.
How the randomness works
The side that lands is chosen first, by your browser's cryptographic random number generator. The coin's spin is then worked out to end on exactly that side, so the animation can never influence the result.
Formulas
Random numbers come from crypto.getRandomValues, the browser's cryptographically secure generator. Math.random is never used, and a test fails if it appears anywhere in the random code.
To pick one of n equally likely outcomes the page reads a 32-bit number and throws away values from the last, partial run of the range (rejection sampling), so rounding never makes some outcomes likelier than others.
accept x if x < 2³² − (2³² mod n), then pick x mod n
A flip is one unbiased draw from two outcomes, so heads and tails each have probability one half. Flipping several coins is that many independent draws; the totals, the share of heads and the longest streak are counted from the results.
Fair draw: before the draw the page shows a commitment, the SHA-256 hash of the canonical JSON of the settings and a secret random seed. The result comes only from that seed, through a stream built from HMAC-SHA-256 in counter mode, read with the same unbiased sampling.
commitment = SHA-256(JSON of settings and seed); block k = HMAC-SHA-256(seed, label ‖ k)
After the draw the seed is revealed. The verify panel recomputes the hash (so the settings were fixed in advance) and the result (so it follows from them). A changed setting, seed or hash is reported as a mismatch.
Sources
- MDN Web Docs, Crypto.getRandomValues(). The browser's cryptographically secure random number API behind every draw.
- Diaconis, Holmes and Montgomery, Dynamical Bias in the Coin Toss (SIAM Review, 2007). Its abstract reports that for natural flips of a real coin the chance of coming up as started is about .51. A virtual coin has no starting side, so this page does not have that bias.
- IETF RFC 2104, HMAC. Defines the keyed hash used to generate the fair-draw random stream.
How we test this
This tool is tested for fair odds, exact landing and reproducible draws every time the site is released, and a release does not ship if a check fails. Example from the test suite: 10 coins, fair draw, seed 0b7e9c41…c4a5 gives HTTTTHHHHT. The test rebuilds the random stream with Node's crypto library and repeats the ten flips itself, then checks the page's code agrees. Other tests run 100,000 flips through a chi-square check and confirm that changing the settings, the seed or the hash is detected.
The test is “fair draw: the published examples reproduce” in tests/random.test.mjs. More on how all tools are tested: our testing approach.
Assumptions and limits
- The randomness is only as good as your browser's generator. No web page can prove a device has not been tampered with.
- Fair draw shows that the settings were fixed before the draw and that the result follows from them. It does not stop someone from privately trying several seeds before publishing a hash, so for anything that matters publish the commitment early, where others can see its time.
- Everything runs in your browser. The history lives on the page until you clear it. A shared-result link carries only the result, and anyone can edit a link, so it is not proof; Fair draw is.
- A flip is a mathematical 50/50 draw, not a simulation of a physical coin, so it has none of the small bias a real, caught coin can have. You can flip 1 to 100 coins at once.
Last reviewed , the date of the latest change to this tool's calculation or content.
Embed this on your site
Free to use on blogs, classroom pages and docs. Paste this where you want the coin flip to appear; it includes a text link back to this page. See every widget on the embed page.
<iframe src="https://www.clevr.tools/embed/coin-flip" width="100%" height="560" style="border:0" loading="lazy" title="Coin flip"></iframe>
<p><a href="https://www.clevr.tools/coin-flip">Coin flip</a> by clevr.tools</p>Helpful answers
Frequently asked questions
- Is this coin flip fair?
- Yes. Each flip reads a random number from your browser's cryptographic generator and turns it into heads or tails with exactly equal probability, with no modulo bias. The spinning coin only decorates a result that is already decided, so the animation can never change the outcome.
- Is a real coin flip really 50/50?
- Almost, but not exactly. A 2007 analysis by Diaconis, Holmes and Montgomery found that vigorously flipped coins that are caught in the hand tend to land the way they started, with a chance of about .51. A virtual coin has no starting side and no spin to wobble, so this one is exactly 50/50.
- Can I prove a flip was not rigged?
- Turn on Fair draw. Before you flip, the page shows a commitment: a SHA-256 fingerprint of the settings and a hidden seed. After the flip it reveals the seed. Anyone can paste the settings, seed and hash into the verify panel and recompute both the hash and the result.
- How do I decide between two things, like pizza or tacos?
- Type your two options into Side one and Side two. The coin then shows your words instead of Heads and Tails.
- How many coins can I flip at once?
- From 1 to 100. You see each coin, the total for each side, your share of heads and your longest streak this session.
- Why do I see long streaks?
- Streaks are a normal feature of random sequences. Independent flips have no memory, so a run of the same side does not make the other side more likely next.
- Is anything sent to a server?
- No. The flip happens in your browser and nothing about it is uploaded. The history stays on the page until you clear it or close it.
Related Tools
Dice Roller
newA free online dice roller: d4 to d100, dice notation like 2d6+3 and 4d6 drop lowest, advantage, presets, exact odds and a fair draw anyone can verify.
Random Number Generator
Pick random numbers in any range: whole numbers or decimals, no repeats, exclusions, lottery-style presets and a fair draw anyone can verify.
Spin the Wheel
newA fair, free wheel spinner and random name picker. Weighted odds, verifiable draws, saved wheels, and nothing uploaded unless you share.