random.cihat.dev

Coin flip

Flip a coin online: press Flip for a fair heads or tails. Flip several coins at once and the tally keeps count across flips.

Coins to flip

Result

–

How to use it

  1. Choose how many coins to flip: one for a decision, more for best-of games or a probability lesson.
  2. Press Flip.
  3. Read the result. The tally underneath adds up every flip until you reset it.

Exactly 50/50

Each coin is one random bit from crypto.getRandomValues, the generator browsers use for encryption keys. Two outcomes divide 2³² evenly, so no value has to be thrown away: heads and tails are exactly equally likely, and every flip is independent of the ones before.

A real coin comes close but is not perfect. Persi Diaconis, Susan Holmes and Richard Montgomery modelled the physics of a hand toss (SIAM Review, 2007) and predicted that a flipped coin lands on the side it started on about 51% of the time. František Bartoš and colleagues then flipped 350,757 coins by hand and found 50.8% same-side landings, while heads and tails overall came out at 50.0% when the starting side was random. An online flip has no starting side, no wobble and no thumb.

Streaks are normal

After five heads in a row, tails is no more likely than before: the coin has no memory. Expecting the other side to be “due” is called the gambler’s fallacy. Long runs turn up far more often than most people guess:

Chance of at least one run of the same side, worked out exactly for fair coins
FlipsRun of the same sideChance
103 or more83%
104 or more46%
1005 or more97%
1006 or more81%
1007 or more54%
1008 or more31%

Flipping many coins at once

With 10 coins, exactly 5 heads comes up only about 25% of the time; 4 or 6 heads is just as ordinary. With 100 coins, exactly 50 heads happens about 8% of the time, but the count lands between 40 and 60 about 96% of the time and between 45 and 55 about 73% of the time. Flip 100 a few times and watch the share of heads settle near one half: the law of large numbers, shown in a few seconds for a maths class.

Choose 3 or 5 coins for a best-of decision in one press: whichever side comes up more wins, and an odd number of coins means there is never a tie. The result also lists each coin in order, so you can read it as a sequence of single flips.

Three options, or a coin you do not trust

To choose among three people with coins, flip two: heads-heads picks the first person, heads-tails the second, tails-heads the third, and tails-tails means you flip both again. Each person gets exactly one chance in three. Set this page to 3 coins and you have a best-of-three; set it to 1 and press twice for the three-way pick.

To get a fair answer from a coin that might be bent, flip it twice: heads then tails counts as heads, tails then heads counts as tails, and two of a kind is thrown away. John von Neumann described the trick in 1951. It works because heads-tails and tails-heads are equally likely whatever the bias, the same idea as the rejection sampling this page uses for its own random numbers.

Where coin tosses decide things

In football the Laws of the Game start every match with one: under IFAB Law 8, the referee tosses a coin and the team that wins the toss chooses which goal to attack in the first half or takes the kick-off. Coin tosses also settle who serves first, who picks first in a playground game or who chooses the film.

Need a yes or no with your own question on screen? Try the yes or no wheel. For more than two outcomes, the dice roller or the random number generator. Working out a share of heads as a percentage? The percentage calculator does it.

Questions people ask

Is an online coin flip fair?

This one is. Each flip uses your browser’s cryptographic random generator, so heads and tails each have a probability of exactly one half.

Is a real coin toss 50/50?

Very nearly. In 350,757 hand flips, heads and tails each came up 50.0% of the time, but coins landed on the side they started on 50.8% of the time.

After several heads, is tails more likely?

No. Each flip is independent, so the chance of tails stays one half whatever came before. Runs of six or more in 100 flips happen about 81% of the time.

Can I flip more than one coin?

Yes: 1, 3, 5, 10 or 100 coins at a time. The result shows how many came up heads and how many tails, and each coin in order.

What does the tally count?

Every coin flipped since you opened the page or last pressed Reset the tally. It is not saved anywhere.