Utinzo

Coin Flip

Flip a virtual coin — heads or tails. Flip multiple times and see statistics.

Did this tool work for you?

How to use this calculator

  1. 1

    Set the number of flips (1 for a single flip, more for a series).

  2. 2

    Click Calculate — a new flip is generated each time.

  3. 3

    For multiple flips, the heads/tails counts and percentages are shown.

Frequently asked questions

How does the tool decide heads or tails?

For each flip it evaluates Math.random() < 0.5 in your browser: below 0.5 is Heads, otherwise Tails. Math.random is a general-purpose pseudo-random generator, not a cryptographic one, and nothing about previous flips affects the next. It is fine for settling who goes first; do not rely on it for anything where someone could profit from predicting the outcome.

What is the maximum number of flips?

The count is clamped between 1 and 1,000. Entering 0, a negative number or text gives a single flip, and entering 5,000 silently runs 1,000. The sequence is printed in full as a comma-separated list, so a 1,000-flip run produces a long line; the Heads and Tails counts underneath are the quick summary.

Why do I get streaks like Heads, Heads, Heads, Heads?

Real random sequences contain streaks far more often than people expect. In a run of 10 fair flips, the chance of at least one stretch of four or more identical results is about 46%. A flip that follows three heads still has exactly a 50% chance of heads, because each flip is independent. Seeing a streak is not evidence that the generator is stuck.

Does the page remember earlier results or keep a running total?

No. Each click is a fresh calculation and the previous set is replaced. The percentages shown cover only the flips in the current run. If you want a long-run tally, raise the number of flips in one go, or write down the counts yourself.

Can it flip a coin for more than two options?

No, the output is only Heads or Tails with equal probability. For three or more choices use a dice roller or assign options to numbers yourself. To pick between two named options, decide beforehand which one is Heads and treat the first result as final.

Is a real coin also 50/50?

Close, but not exactly. A study of hand-flipped coins by Diaconis, Holmes and Montgomery found a small bias towards the side that starts facing up, around 51%. A virtual coin has no starting side, so the code uses an exact 50% split by design.

Why does 100 flips rarely land on exactly 50 heads?

Exactly 50 heads in 100 fair flips happens only about 8% of the time. About seven runs in ten land between 45 and 55 heads, so anything in that band is normal. The proportion converges on 50% as flips increase, but the raw difference between heads and tails tends to grow slowly rather than shrink.

About coin flip

Coin flip odds: what a run of flips looks like

How ten fair flips usually come out

The most common outcome of ten flips is five heads, yet that happens only about one time in four. The table lists the chance of each possible head count, calculated from the binomial distribution for ten 50/50 flips. Splits such as 6-4 or 4-6 are completely ordinary, and a 7-3 or 3-7 split turns up roughly one run in four. Extreme results like 9-1 or 10-0 do occur, but only about one run in 50 reaches 9 or more of either side.

Probability of each number of heads in 10 fair flips
HeadsTailsWays it can happen (of 1,024)Chance
01010.1%
19101.0%
28454.4%
3712011.7%
4621020.5%
5525224.6%
6421020.5%
7312011.7%
82454.4%
91101.0%
10010.1%

Worked example: ten flips

One real run with 10 flips returned Tails, Heads, Tails, Tails, Tails, Heads, Tails, Heads, Heads, Tails, which the tool summarised as 4 heads (40.0%) and 6 tails (60.0%), followed by the line "Expected: 50% / 50% (theoretical)". Your run will differ, because each click draws new values. A 4-6 split is one of the two most likely outcomes after 5-5 in the table above, so it should not be read as a sign of bias.

Worked example: a single flip and the 1,000 cap

A single flip prints just "Result" with the side that came up, then the counts as 1 and 0 with 100.0% and 0.0%, a reminder that percentages are meaningless for one trial. Entering 5,000 flips produced counts of 503 heads and 497 tails: the tool had quietly limited the run to 1,000 flips, which is why the two numbers sum to 1,000 rather than 5,000.

Where the randomness comes from

Each flip calls Math.random() and compares it with 0.5. That function is a pseudo-random generator supplied by the browser, seeded by the browser itself, with no link to earlier flips and no way to replay a sequence. It is suitable for games, sports kick-offs and tie-breaks among friends. It is not designed for lotteries, security tokens or anything where an adversary might try to predict the next value.

Running a fair decision with it

Agree the rule before flipping: say which side means which option and whether you will accept the first result. If you repeat a flip until you like the answer, the decision is no longer made by chance. For best-of-three style contests, set flips to 3 or 5 and count the majority; with an odd number of flips a tie is impossible.

Coin Flip – Utinzo

Learn more from an authoritative source:

Wikipedia
Related tools

Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →