# 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.

- URL: https://generate.now/coin-flip
- Category: Data & types
- Price: free, no account required
- AI-powered: no (runs in the browser)
- Last updated: 2026-11-11

## 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.

## 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.

## 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.

| Flips | Run of 4+ | Run of 5+ | Run of 7+ |
| --- | --- | --- | --- |
| 10 | 46.48% | 21.68% | 3.91% |
| 20 | 76.84% | 45.84% | 11.51% |
| 50 | 98.12% | 82.09% | 30.89% |
| 100 | 99.97% | 97.17% | 54.23% |

*Chance of at least one run of the same side, by number of flips*

## 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.

## When to use the Coin Flip

- Settle a two-way choice or decide who goes first
- Show a class that streaks appear in random sequences
- Generate a heads and tails sequence for a statistics exercise
- Compare observed counts against the expected 50% over 1,000 flips

## Coin Flip examples

### 1 flip

```
Heads
```

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

### 20 flips

```
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

```
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.

## 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.

## References

- [Web Cryptography API: the getRandomValues method](https://w3c.github.io/webcrypto/#Crypto-method-getRandomValues): W3C. The specification of the browser's source of cryptographically strong random values that each flip is drawn from.
- [Fair coins tend to land on the same side they started: Evidence from 350,757 flips](https://arxiv.org/abs/2310.04153): arXiv (Bartoš et al.). Reports a same-side probability of 0.508 for hand-tossed coins and no heads-tails bias when the starting side is random.
- [Crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues): MDN Web Docs. Usage notes and browser support for the same method.

## Related tools

- [Dice Roller](https://generate.now/dice): Roll d4, d6, d8, d10, d12, d20, d100 or a custom die, up to 100 at once, with a modifier. Type dice notation such as 3d6+2 or 2d20kh1.
- [Random Number Generator](https://generate.now/random-number): Generate random integers or decimals between any two numbers, up to 10,000 at a time. Allow or forbid repeats, and add a seed for a repeatable sequence.
- [Random Name Picker](https://generate.now/random-picker): Paste a list of names, then pick one or more winners at random, shuffle the whole list, or split it into teams. Every draw is unbiased.

## More in Data & types

- [UUID Generator](https://generate.now/uuid): Generate UUID v4, v7 or v1, one at a time or up to 1,000. Output as standard, uppercase, braces (GUID), no hyphens, URN or Base64, and decode any UUID you paste.
- [JSON to TypeScript Types](https://generate.now/json-to-types): Paste JSON and get TypeScript interfaces, type aliases, a Zod schema or a Valibot schema. Updates as you type, in your browser.
- [Mock Data Generator](https://generate.now/mock-data): Generate up to 1,000 rows of fake test data as JSON, NDJSON, CSV or SQL INSERT. Pick the fields, set an optional seed, and copy or download.

[All 39 tools](https://generate.now/tools)
