Coin flip online

Flip one coin or many. The counter and the longest streak are shown, so you can judge the fairness yourself.

Live uniformity test

🔒 Cryptographic local draw: nothing is sent to a server.

Why this one is genuinely fair

Almost every online generator rests on a single line: Math.floor(Math.random() * n). It has two flaws. Math.random() is not a cryptographic generator — its sequence is predictable to anyone who observes enough of it. And squeezing a value from a large space into a small range with a plain remainder favours the first values: that is modulo bias.

This tool draws its bytes from the browser's crypto API and applies rejection sampling: values landing in the overflow zone are discarded and redrawn. Measured over three million draws reduced to three values, the plain remainder deviates by 0.73 % where our method stays at 0.11 %. The button below re-runs that test live, on your machine: you do not have to take our word for it.

A run of ten heads is not a bug

It is the question that always comes back: « the coin is rigged, I got seven heads in a row ». It is not. Over a hundred flips the expected longest run is around six or seven; over a hundred thousand, around seventeen. We measured it: a hundred thousand flips gave 50,184 heads and a longest run of 17.

A sequence that « looks random », neatly alternating, would be the actual sign of rigging. That is why this tool displays the longest run: it tells you the randomness is working, precisely when your intuition insists otherwise.

Frequently asked questions

Is the coin genuinely fair?

Yes, and you can check: the test button runs tens of thousands of draws and shows the distribution obtained. Each side should land near 50 %, with the gap shrinking as the number of flips grows.

Can I flip several coins at once?

Yes, up to ten thousand. The counter gives the total for each side, which makes the tool useful for a classroom probability demonstration.

Is the result stored anywhere?

No. Everything is computed in your browser; nothing is transmitted or kept.

Related tools