Coin Flip

Flip a virtual coin for heads or tails, or run 10 or 100 flips instantly to watch the odds settle toward 50/50.

Tap Flip to start

Randomized with crypto.getRandomValues() — a cryptographically secure source, not a predictable script.

Session stats

Heads
0
Tails
0
Total flips
0
Current streak
Heads 0% Tails 0%

Recent flips (0)

No flips yet

Worked examples

Quick decision

Deciding who does the dishes tonight

Two roommates can't agree, so they tap Flip Coin once and let it decide — heads means one person, tails the other, with no way for either side to influence the result.

Method
Single tap
P(heads)
50%
P(tails)
50%

50/50 either way — genuinely unpredictable, so the outcome feels fair to both people.

Fairness test

Checking a coin flipper's fairness with a 100-flip batch

Curious whether the generator is really unbiased, a user runs "Flip 100×" once and compares the split against the theoretical 50/50 expectation.

Batch size
100 flips
Expected split
≈50 / ≈50
Method
Instant, no animation

48 Heads / 52 Tails in one real run — close to even, exactly as probability predicts.

How the randomness works

Each flip is an independent Bernoulli trial: heads and tails each have exactly a 50% chance, unaffected by any flip before it. The coin's side comes from the lowest bit of a value produced by crypto.getRandomValues(), the browser's cryptographically secure random number generator — the bits it produces are statistically unbiased, so this avoids the subtle patterns that a simple seeded pseudo-random function can have.

P(same side, n times in a row) = 0.5ⁿ

That formula is why streaks feel surprising but are perfectly normal: 5 in a row happens about 1 time in 32 (≈3.1%), and 10 in a row about 1 time in 1,024 (≈0.1%) — rare for any single run, but common across the millions of flips made every day. It's also why a single 10-flip batch rarely lands exactly 5/5: the chart on the right shows how the outcomes actually spread out.

012345678910

Chance of getting exactly k heads in 10 flips (binomial distribution, p = 0.5). About 89% of 10-flip batches land somewhere between 3 and 7 heads — landing on precisely 5 is common, but not the guaranteed result.

Frequently asked questions

Is this coin flip actually random and fair?

Yes. Every flip reads a value from the browser's crypto.getRandomValues() — a cryptographically secure random number generator built into the browser, the same class of source used for security tokens — rather than a simple seeded pseudo-random function. The lowest bit of that value decides heads or tails, and a CSPRNG's bits are unbiased, so each side has an honest, independent 50% chance every time.

I got 6 heads in a row — is the coin broken?

No, that's expected behavior, not a bug. The chance of the same side landing 6 times in a row is 0.5⁶ ≈ 1.6% for any given attempt, which sounds rare, but with thousands of people flipping every day someone hits a long streak constantly. Random sequences naturally clump — a coin with zero streaks longer than 2 or 3 would actually be suspicious, not fair.

What's the difference between one flip and running 'Flip 100×'?

A single flip animates the coin spinning and landing, mirroring an actual physical toss — useful when you need one real decision. "Flip 100×" skips the animation and instantly generates 100 independent flips in a batch, showing you the resulting Heads/Tails split. It exists to demonstrate the statistics (law of large numbers) rather than to replace the one-at-a-time decision flip.

Does the Heads/Tails ratio ever land exactly 50/50?

Sometimes, especially at small even numbers of flips, but it isn't guaranteed even over a large session. The ratio's expected value is 50%, and the spread of likely outcomes narrows as you flip more — but the exact count only has to differ by a couple of flips to move the percentage. Don't read a 48/52 split after 500 flips as a biased coin; that's well within normal statistical variance.

Will my stats be saved if I refresh the page or come back later?

No — the Heads/Tails counts, streak and history shown here are session-only counters kept in the page's memory, not saved to your device or any server. Reloading the page resets everything back to zero, and the Reset stats button does the same thing manually without a reload. Nothing you flip here is ever uploaded anywhere.

Can I use this for a real decision, like a coin toss before a game?

Yes. A single tap of Flip Coin is a genuine, independent 50/50 event generated the moment you click, so it works exactly like a physical coin toss for picking who goes first, breaking a tie, or settling a small decision — with the added benefit that neither side can influence how it lands.