Random Number Generator
Numbers · Lists · Dice · Coin
Quick:

Result

?
Set a range and press Generate.

How to use the random number generator

  1. Numbers: type the lowest number in From and the highest in To. Both are included, so 1 to 10 can give 1 and 10. Set How many and press Generate (or Enter).
  2. Tick No repeats to draw like balls from a bag, so every number is different. Choose Smallest first to sort them, as on a lottery ticket.
  3. Choose Type for decimals such as 0.37 or 12.5, and Copy as to copy one number per line (for Excel or Google Sheets) or a comma-separated list (for code).
  4. Pick from a list: paste names, tasks or options, one per line, choose how many to pick and click Pick. Shuffle the whole list puts every line in a random order, for example a presentation order. To split a list into groups, use the Random Team Generator. To pick names one by one in front of a group, use Spin the Wheel.
  5. Dice & coin: roll 1 to 100 dice with 4 to 100 sides and see the total, or flip up to 1,000 coins and see how many came up heads.

Every result shows the time it was made, which is useful when you share a giveaway draw. Your earlier results stay in the list under the result until you leave the page.

Is it really random and fair?

The numbers come from crypto.getRandomValues, the cryptographically secure random generator built into your browser and operating system. It is fed with noise from the hardware, and its output cannot be predicted, not even by someone who has seen earlier results. The simpler Math.random() that many websites use is fine for games, but it is not designed to be unpredictable.

The page also avoids modulo bias. A random 32-bit value has 4,294,967,296 possible values. If you take that value "modulo 6" to roll a die, 4 of the 6 faces get one extra chance, because 4,294,967,296 is not a multiple of 6. The difference is tiny, but for large ranges it grows. This generator throws away values from the uneven end and draws again (rejection sampling), so every number in your range has exactly the same chance.

No repeats uses a Fisher–Yates shuffle or draws until it has enough different numbers, which gives every possible set of numbers the same chance.

Why repeats happen more often than you think

Without No repeats, each number is drawn on its own, so the same number can come again. People expect that to be rare, but it is common. It is the same math as the birthday problem: in a group of only 23 people, there is a 50% chance that two share a birthday.

RangeNumbers drawnChance of at least one repeat
1–10450%
1–1001250%
1–1002087%
1–3652351%
1–10003851%
1–1,000,0001,17850%

Lottery odds

Use Lottery 6 of 49 (or set your own range with No repeats and Smallest first) to make a lottery pick. A random pick does not raise your chance of winning, but people often play birthdays (numbers up to 31) and patterns, so a random pick means you share a win with fewer people.

GameHow to draw hereOdds of the top prize
6 of 49 (such as Lotto 6/49 in Canada)1–49, 6 numbers, no repeats1 in 13,983,816
EuroMillions1–50, 5 numbers + 1–12, 2 numbers1 in 139,838,160
Powerball (US)1–69, 5 numbers + 1–26, 1 number1 in 292,201,338
Pick 3 / Pick 40–999 or 0–9999 with leading zeros1 in 1,000 / 1 in 10,000

The odds for "k of n" are n choose k: the number of different sets of k numbers. For 6 of 49 that is 49 × 48 × 47 × 46 × 45 × 44 ÷ (6 × 5 × 4 × 3 × 2 × 1) = 13,983,816.

Random numbers in Excel, Google Sheets and code

WhereRandom number from 1 to 100Notes
Excel / Google Sheets=RANDBETWEEN(1,100)Changes on every edit. Copy and Paste values to keep it. =RAND() gives a decimal from 0 to 1.
Excel 365 (no repeats)=TAKE(SORTBY(SEQUENCE(100),RANDARRAY(100)),10)10 different numbers from 1 to 100
Pythonrandom.randint(1, 100)Both ends included. random.sample(range(1, 50), 6) = no repeats. Use secrets.randbelow(100) + 1 for security.
JavaScriptMath.floor(Math.random() * 100) + 1For security use crypto.getRandomValues with rejection sampling.
JavaThreadLocalRandom.current().nextInt(1, 101)The upper end is not included, so write 101. SecureRandom for security.
SQL (MySQL)FLOOR(1 + RAND() * 100)ORDER BY RAND() LIMIT 1 picks a random row (slow on big tables).

Frequently asked questions

How do I get a random number between 1 and 10?

Type 1 in From and 10 in To (or click the 1–10 button) and press Generate. Each number from 1 to 10 has the same chance: 1 in 10. Both ends are included. For 1 to 100, use the 1–100 button or type 100 in To.

Is this random number generator really random?

It uses crypto.getRandomValues, the cryptographically secure random generator of your browser and operating system, which is fed by hardware noise. Its numbers cannot be predicted, and the page uses rejection sampling so that every number in the range has exactly the same chance. That is good enough for giveaways, games, classroom picks and sampling. Official lotteries use certified machines or hardware generators, as their law requires.

Why did I get the same number twice?

Because each draw is independent, repeats happen more often than people expect. If you draw 12 numbers from 1 to 100, the chance that at least two are the same is about 50%. Tick No repeats to get only different numbers, like drawing balls from a bag without putting them back.

How do I generate random numbers without repeats?

Tick No repeats, set the range and how many numbers you need, and press Generate. How many cannot be larger than the number of values in the range: 1 to 49 has 49 values, so you can draw up to 49 different numbers. Choose Smallest first to sort them, as on a lottery ticket.

How do I pick a random winner from a list of names?

Open the List tab, paste the names one per line (for example the comments of a giveaway post), choose how many winners you need and click Pick. Every line has the same chance and a name is never picked twice. Duplicate lines are removed first, so a person who is listed twice does not get two chances, unless you turn that option off.

What are the odds of winning a 6 from 49 lottery?

1 in 13,983,816 for all six numbers. That is the number of different ways to choose 6 numbers from 49 (49 choose 6). Picking your numbers with a random number generator does not change the odds, but it avoids popular patterns such as birthdays, so you share a win with fewer people.

Are my numbers or lists sent to a server?

No. Everything happens in your browser with JavaScript, so it also works offline once the page has loaded. Your settings, such as the range, are kept in this browser for your next visit. The list of names and the results are never stored or sent.

More free tools