Skip to content

Coin Flip

Flip a coin online for heads or tails, or flip up to 10,000 at once and see the counts, percentages, full sequence and longest streak.

Ready to flip

Press Flip to flip the coin.

Each flip is an independent 1 in 2 draw from crypto.getRandomValues, made in your browser.

Number of flips

01 · Definition

What is an online coin flip?

An online coin flip picks heads or tails with equal probability using a random number generator instead of a physical coin. Each flip is independent: the result does not depend on earlier flips, so after five heads in a row the chance of heads on the next flip is still 1 in 2.

02 · Overview

How the Coin Flip works

Press Flip for a single heads or tails, or choose 10, 100, 1,000 or a custom number of flips up to 10,000. For more than one flip the tool shows how many heads and tails came up, each as a percentage, the full sequence in order, and the longest run of the same side. Every flip is an independent draw with probability exactly 1/2 from crypto.getRandomValues. Nothing is flipped until you press the button. The coin animation is skipped when your system asks for reduced motion, and the result is announced to screen readers immediately.

03 · Guide

Streaks are normal

Runs of the same side feel suspicious but are expected. In 20 fair flips, the chance of at least one run of 5 or more identical results (heads or tails) is 45.84%: 480,670 of the 1,048,576 possible sequences contain one. That figure is exact. A script counted the sequences with no run that long and subtracted from the total, and a second script checked the count by listing all 1,048,576 sequences.

The table gives the same exact calculation for other lengths. In 100 flips a run of 7 or more is more likely than not.

An even split is also less common than people expect. Exactly 5 heads in 10 flips happens 24.6% of the time (252 of 1,024 sequences), and exactly 50 heads in 100 flips about 8.0% of the time.

FlipsRun of 4+Run of 5+Run of 7+
1046.48%21.68%3.91%
2076.84%45.84%11.51%
5098.12%82.09%30.89%
10099.97%97.17%54.23%
Chance of at least one run of the same side, by number of flips

04 · Guide

Online flip vs a real coin

Each flip here is one random bit, taken without bias from the browser's cryptographic random source, so heads and tails each have probability exactly 1/2 and the software has no memory of earlier flips.

A coin tossed by hand is very slightly different. A study that collected 350,757 real coin flips found that a coin lands on the side that was facing up when it was tossed about 50.8% of the time, as a physics model by Diaconis, Holmes and Montgomery had predicted. With the starting side chosen at random, heads and tails came up equally often.

05 · Use cases

When to use the Coin Flip

  1. 01

    Settle a two-way choice or decide who goes first

  2. 02

    Show a class that streaks appear in random sequences

  3. 03

    Generate a heads and tails sequence for a statistics exercise

  4. 04

    Compare observed counts against the expected 50% over 1,000 flips

06 · Examples

Coin Flip examples

1 flip

ex 01

Heads

One draw with a 1 in 2 chance of each side.

20 flips

ex 02

TTTHTTHHHHHTTHHHTTTH Heads: 10 (50%) Tails: 10 (50%) Longest streak: 5 heads

A real run from the tool. It happens to split evenly and still contains a run of five heads.

1,000 flips

ex 03

Heads: 520 (52%) Tails: 480 (48%) Longest streak: 13 tails

Counts drift a few percent from 50% even over 1,000 flips. The full sequence is shown in the tool.

07 · FAQ

Coin Flip: frequently asked questions

Is this coin flip fair?

Yes. Each flip takes one unbiased value, 0 or 1, from crypto.getRandomValues, the browser's cryptographic random number source. Heads and tails each have probability exactly 1/2, and the code keeps no state between flips that could influence the next one. In a test of 1,000,000 flips, 500,397 were heads.

I got five heads in a row. Is something wrong?

No. In 20 flips there is a 45.84% chance of at least one run of five or more of the same side, and in 100 flips it is 97.17%. After a streak the next flip is still 1 in 2 either way; a fair coin does not balance itself out.

How many coins can I flip at once?

Between 1 and 10,000. Choose 1, 10, 100 or 1,000, or pick Custom and type a number. A value outside 1 to 10,000 shows an error instead of being changed for you.

What does the tool show for many flips?

The number of heads and tails, each as a percentage of the flips, the longest run of the same side and which side it was, and the complete sequence as H and T in the order flipped. Copy puts the sequence and the counts on your clipboard.

Does the animation decide the result?

No. The result is drawn first, then the coin turns to show it. With reduced motion switched on in your system settings the coin shows the result without spinning. Screen readers are told the result as soon as it is drawn.

Is anything sent to a server?

The flips are made in your browser and the results are not sent to our server. The page loads analytics that record page views and button use, including how many coins were flipped, not the outcomes.

08 · Reference

Specs and further reading

These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.

09 · More

Tools that pair with Coin Flip

Last updated .