AZ Tools

Coin Flip Simulator

Random

A simple random-experiment runner backed by `Math.random()`. Tune the heads probability if you want to model a biased coin. For sample sizes up to 1000 the raw sequence is rendered so you can spot runs visually; bigger runs collapse to summary statistics.

Math.random()-based — fine for stats / demos, not for cryptographic draws.

How to use

  1. Type how many flips you want (up to 10 000).
  2. Drag the bias slider if you want a non-fair coin.
  3. Hit Flip. The expected heads count and the observed numbers sit side by side for comparison.

Frequently asked questions

Why does the longest run get long for a fair coin?
Runs of about `log2(N)` flips are expected by chance in a fair sequence. So 1024 flips routinely contain a run of ten heads in a row — that's regression to the mean, not a sign the coin is rigged.
Is this cryptographically random?
No — `Math.random()` is fine for simulations and demos but not for raffles, draws, or anything where bias would be costly. For that, use a verifiable random source.

Related tools