RandomBasis

Heads or tails

Coin Flip

Flip a coin online — once, or up to a hundred times with a running tally.

Runs locally in your browser. Nothing you flip is ever sent to a server.

Press "Flip" to toss the coin.

About this coin flip

Press Flip and you get heads or tails, decided by your browser's cryptographic random source. It is the fastest way to settle something when nobody has a coin in their pocket, and it works on a phone in the middle of a conversation.

Flipping several times

Raise the number of flips to run a whole sequence at once. The tally of heads and tails appears above the sequence, so you can see the split immediately. This is the mode to use for a best-of-three, or for showing a class what a run of fifty flips actually looks like.

Streaks are normal

People expect heads and tails to alternate more than they really do. In fifty flips, a run of five or six the same way is likely rather than surprising, and the total rarely lands on exactly twenty-five each. Each flip is independent: a coin that has come up heads four times is no more likely to give tails next. Flipping a batch here is a quick way to see that for yourself.

Is it fairer than a real coin?

A real coin is very slightly biased by how it is caught and which side starts facing up, and a spun coin is worse. A digital flip has no such physical quirks — it comes down to the quality of the random source, and this one uses the browser's cryptographic generator with rejection sampling, so the two outcomes are exactly equally likely.

Common uses

How the randomness works

Each flip draws a value from your browser's cryptographic random source and discards anything that would fall outside a clean multiple of two, so neither side is favoured. Every flip is independent of the ones before it.

How do I flip a coin online?

Press Flip and you get heads or tails. Press again for another flip.

Can I flip several coins at once?

Yes. Set how many flips you want, up to 100, and the tally of heads and tails is shown with the full sequence.

Is an online coin flip fair?

Yes, and arguably fairer than a real one. Each flip uses your browser's cryptographic random source, so heads and tails are exactly equally likely every time.

Why did I get five heads in a row?

Because that is what randomness looks like. Five heads in a row happens roughly once in every 32 runs of five flips, and past flips never influence the next one.

Can I use it to settle a decision?

Yes. That is the main use. Assign heads and tails before you flip so the result is binding.

Does it work offline?

Once the page has loaded, the flip happens entirely on your device, so it keeps working if the connection drops.