webutilkit

Coin Flip

Flip one or many virtual coins using a secure random source in your browser — fair, every time.

How it works

Each flip draws one value from crypto.getRandomValues and maps it to heads or tails with equal probability. Flipping several coins at once draws each one independently, exactly like tossing a handful of real coins.

Why not Math.random?

For a casual coin flip either source would work, but crypto.getRandomValues is the same cryptographically secure generator used elsewhere on this site for passwords and tokens, so there is no reason to reach for a weaker one here.

Settling ties fairly

A single flip is the classic way to make an arbitrary choice between two options without bias. Flipping a large batch instead shows how the split between heads and tails narrows toward 50/50 as the number of flips grows.

Frequently asked questions

Is this actually a fair 50/50?

Yes, each flip is an independent, unbiased coin toss drawn from crypto.getRandomValues, a cryptographically secure random source.

Why flip more than one coin at once?

Flipping a batch is a quick way to see the split between heads and tails over many tosses, rather than one outcome at a time.