Random Number Between 1 and 2

Generate a random whole number from 1 to 2, for a coin-style 50/50 choice between two options.

Press Generate for a random number between 1 and 2, ends included.

Odds for numbers between 1 and 2

Possible numbers2
Chance of any one number1 in 2 (50.0%)
Average result over many picks1.5
Even / odd numbers1 even, 1 odd

Using 1 or 2 as a coin flip

No coin to hand? Call 1 heads and 2 tails, or give each option a number before you press Generate. Agree on what each number means first, so nobody can argue with the result afterwards.

Two picks together give four equally likely pairs (1 then 1, 1 then 2, 2 then 1, 2 then 2), so a pair of 1–2 picks can stand in for a 1 to 4 pick, and three picks give eight outcomes. A coin can't split three ways, though. The usual workaround is to flip twice, give three of the four pairs to your options and flip again on the fourth. Here you can simply set the range to 1 to 3.

Totals of two numbers from 1 to 2

Generate two numbers with repeats allowed and add them, as you would with a pair of dice. There are 4 equally likely pairs, but the totals aren't equally likely: the middle total, 3, can be made 2 ways, while 2 and 4 can each be made only one way.

TotalWays to make itChance
2125.0%
3250.0%
4125.0%

Streaks: the same number again and again

Short streaks are normal with only 2 options. Whatever the first pick is, each further pick matches it with a 1 in 2 chance, so the odds of a run shrink like this:

Same number this many times in a rowChance
250.0%
325.0%
412.5%
56.3%
100.20%

A streak doesn't make the other number "due". Every pick starts fresh, so the next one is still 1 in 2.

Over a longer sequence, some streak is almost certain. These are the chances that 20 picks contain at least one run of the same number:

Run of at leastChance in 20 picks
3 in a row97.9%
4 in a row76.8%
5 in a row45.8%
6 in a row23.7%

So if you're checking whether a list of results looks random, a long run isn't evidence against it.

For a decision that feels fairer than a single pick, ask for 3 numbers with repeats allowed and go with whichever number shows up more. Three picks can't split evenly, so there's always a winner, and whoever wins the first pick goes on to take the series 75% of the time.

How often you get an exact 50/50 split

Each number comes up half the time over many picks, yet an exactly even split gets less likely the more you pick:

PicksExactly half 1s and half 2sWithin 10% of half
1024.6%65.6%
2017.6%73.7%
5011.2%88.1%
1008.0%96.5%

The share settles toward 50% while the exact match becomes rarer, which is how a fair coin behaves too.

Counting 1,000 results

Ask for 1,000 numbers with repeats allowed and you'll rarely get exactly 500 of each. That happens only 2.52% of the time. At least 95% of the time the count of 1s lands between 469 and 531.

Best of three, five or seven

For a bigger decision, play a series: each pick is a point, and the first to win a majority takes it. Longer series take more picks but leave less to a single result.

SeriesFewest picksMost picksAverage picksChance it goes the distance
Best of 3232.550.0%
Best of 5354.1337.5%
Best of 7475.8131.3%

If all you have is a coin you suspect is lopsided, there's an old fix: flip it twice, call heads then tails one result and tails then heads the other, and flip again on two of a kind. Both mixed orders are equally likely whatever the bias. It just takes more flips, about four on average for a fair coin. With a generator you don't need it, since 1 and 2 are exactly even.

Deciding who goes first

Many games need a first player. Pick 1 or 2 once and the winner starts. For a run of games, you can alternate after that. Over 10 games, alternating gives each side exactly 5 starts. Picking fresh every game gives a 5 to 5 split only 24.6% of the time.

How the number is picked

Your browser's Web Crypto API supplies a 32-bit random value (4,294,967,296 possibilities). Since 2 is a power of two, it divides that total exactly: 2,147,483,648 values map to each number and none are wasted.

Frequently asked questions

Is a random 1 or 2 the same as flipping a coin?

For the odds, yes: each number has exactly a 50% chance, like a fair coin, and every pick is independent of the one before.

What are the odds of getting 1 five times in a row?

1 in 32 (3.1%), because each pick is a 1 in 2 chance: ½ × ½ × ½ × ½ × ½. Any other particular sequence of five, such as 1-2-2-1-2, is exactly as likely.