Random Number Generator

This free online random number generator creates one or more random whole numbers between any minimum and maximum value you choose. Optionally allow repeated values or generate a set of unique numbers, perfect for raffles, sampling, or quick games of chance.


How to Use the Random Number Generator

  1. Enter the lower bound in "Minimum Value" and the upper bound in "Maximum Value".
  2. Enter how many numbers to produce in "How Many Numbers to Generate".
  3. Check or uncheck "Allow duplicates" depending on whether repeated numbers are okay.
  4. Click "Generate" to see your random numbers appear as badges.

How the Numbers Are Produced

The minimum and maximum are both included in the range, so 1 to 6 can give any of the six faces of a die. Decimal inputs are cut down to whole numbers by dropping the fractional part: a minimum of 1.9 is treated as 1, and a count of 3.7 produces 3 numbers.

With duplicates allowed, each number is drawn independently, like rolling a die again and again. With duplicates switched off, the tool lists every whole number in the range, shuffles the list, and hands you the first ones, like drawing chits from a bowl without putting them back. The numbers are shown in the order they were drawn, not sorted.

Practical Uses

  • Lucky draws: for a housing society draw with 240 entries, number the coupons 1 to 240, turn off duplicates, and generate as many numbers as there are prizes. Do the draw in front of the participants so the result is transparent.
  • Random samples: to survey 15 students from a class with roll numbers 1 to 60, generate 15 unique numbers in that range. Random selection avoids the bias of picking only those who volunteer or sit in front.
  • Classroom and games: deciding the order of presentations, picking quiz questions from a numbered bank, or simulating dice when none are at hand.

How Often Do Repeats Happen?

With duplicates allowed, repeats turn up sooner than most people expect. The chance of at least one repeated number is:

RangeNumbers drawnChance of a repeat
1–6344.4%
1–1001037.2%
1–3652350.7%
1–10002017.4%

The 1–365 row is the well-known birthday problem: in a group of 23 people, it is slightly more likely than not that two share a birthday. If a repeat would spoil your purpose, such as two prizes going to one coupon, switch duplicates off.

Limitations

  • The generator uses the browser's Math.random(), a pseudo-random algorithm. It is fine for draws, games and sampling, but it is not designed for security. Do not use it to create passwords, OTPs or encryption keys.
  • Results cannot be reproduced. There is no seed setting, so save or copy the numbers if you need a record.
  • In unique mode the whole range is built in memory, so a range of many millions of numbers can make the page slow. Keep the range to what you actually need.
  • Draws that carry legal or financial weight, such as government lotteries or official allotments, follow their own prescribed procedures and should not rely on a web tool.

Frequently Asked Questions

It uses JavaScript's Math.random() scaled to your range with the formula Math.floor(Math.random() * (max - min + 1)) + min, so every whole number between the minimum and maximum has an equal chance of being chosen.

When checked, each number is generated independently and can repeat. When unchecked, the calculator shuffles every number in the range using a Fisher-Yates shuffle and takes the first values, guaranteeing no duplicates.

Yes. Both ends of the range can be generated. A range of 1 to 10 has ten possible values, each with a 1 in 10 chance on every draw.

Negative whole numbers work; for example, a range of −10 to 10 gives 21 possible values. Decimals are not generated, and decimal limits are cut to whole numbers. For values such as 0.00 to 1.00, generate 0 to 100 and divide the result by 100.

No. Math.random() is not a cryptographically secure source, so its output could in principle be predicted. Use a password manager or your operating system's secure generator for anything security-related.
No ratings yet — be the first!
Rate this calculator:
Was this tool helpful?