Back to blog
Generators4 min readby Narayana Peddakotla

Online Coin Flips: Probability, Streaks, and Simulation Limits

Understand simulated heads-or-tails results, why streaks occur, and when an online coin flip is unsuitable for a decision.

Use the related XKit tool

Open Coin Flip

An online coin flip simulates a heads-or-tails outcome. XKit uses JavaScript Math.random() to choose the result. It is useful for casual choices and probability demonstrations, but it does not provide physical randomness, cryptographic security, or an independently audited draw.

Why three heads in a row is not evidence of a broken coin

For an ideal independent fair coin, the probability of three heads in three flips is (1/2)³ = 1/8, or 12.5%. A short sequence can be uneven even when each outcome has equal probability.

A previous run of heads does not make tails due on the next flip. The expected heads proportion approaches one half over many ideal trials, but an individual sequence does not have to alternate or end evenly.

How to use the simulation

Open the coin flip tool, trigger a flip, and read the displayed result. Use History to inspect recent flips and Statistics to compare the observed heads and tails counts.

For a classroom experiment, record a fixed number of trials before starting. Compare the observed proportion with 50% without changing the stopping point to obtain a preferred outcome.

When a simulated coin flip is the wrong tool

Do not use this generator for security tokens, money-bearing drawings, or decisions that require a verifiable random process. Math.random() is a pseudorandom API, and the displayed history is not an independent audit trail.

For consequential choices, agree on the decision process before running it. A simulation can choose between labels, but it cannot establish that the underlying choice is appropriate.

Sources and technical references

Frequently Asked Questions

Is XKit's coin flip truly random?

No. It uses JavaScript Math.random() to simulate a coin toss. The output is pseudorandom and is not suitable for cryptographic use or audited draws.

Does a run of heads mean tails is more likely next?

No. For independent fair coin trials, the next outcome still has a one-half probability. Earlier outcomes do not create a debt that later flips must repay.