Skip to content

Random Number Generator: Fair Draws, No Duplicates, Decimals

Generate secure random whole numbers or decimals in any range, up to 10,000 at once, with a no-duplicates option for raffles and draws. How fair randomness works.

3 min read

Picking a raffle winner, choosing a sample, assigning seats, or drawing six lottery-style numbers all need the same thing: numbers that nobody can predict or influence. Our random number generator produces them with your browser's cryptographic random source. This guide explains the settings and when to use each.

How to generate numbers

  1. Choose a type: whole numbers or decimals.
  2. Set the range with Min and Max. Both ends are included, so 1 to 100 can produce 1 and 100.
  3. Choose how many numbers you want, from 1 to 10,000.
  4. For whole numbers, tick No duplicates if each number may appear only once.
  5. Tick Sort to list the results in ascending order.
  6. Press Generate. With more than one result, use Copy to paste the list elsewhere.

For decimals you can set 0 to 10 decimal places.

No duplicates: drawing without replacement

With No duplicates on, the generator works like drawing numbered balls from a bag without putting them back. That is what you want for:

  • Raffles and prize draws with several winners.
  • Lottery-style picks, such as 6 numbers from 1 to 49.
  • Random seating or running orders, using 1 to the class size.

You cannot ask for more unique numbers than exist in the range. Asking for 20 unique numbers between 1 and 10 gives a clear error, because only 10 exist.

With No duplicates off, every number is drawn independently, like rolling a die again and again. Repeats are normal. With 30 draws from 1 to 100, there is about a 99% chance at least one number repeats.

Is it truly random and fair?

Numbers come from crypto.getRandomValues, the browser's cryptographically secure random generator, which is designed to be unpredictable.

The generator also uses rejection sampling. Simple methods take a big random number and use the remainder after dividing by the range size. That makes some results slightly more likely than others whenever the range does not divide evenly. Rejection sampling throws away the few values that would cause this bias, so every number in your range has exactly the same chance.

For unique draws, the generator shuffles the range with a Fisher–Yates shuffle, a standard method in which every possible order is equally likely.

Worked examples

Raffle with 250 tickets and 3 prizes. Min 1, Max 250, How many 3, No duplicates on. Each ticket has a 3 in 250 (1.2%) chance of winning something.

Lottery-style numbers. Min 1, Max 49, How many 6, No duplicates on, Sort on. There are 13,983,816 possible combinations, so any one set has about a 1 in 14 million chance.

Random sample for a survey. You have 1,200 customers numbered 1 to 1,200 and want 50. Use No duplicates, then contact the customers with those numbers.

Decimal test data. Min 0, Max 1, How many 100, Decimal places 4 gives values such as 0.3817 for spreadsheets or simulations.

Tips for a transparent draw

  • Publish the rules first. Say how many winners there are, the number range and whether a person can win twice.
  • Number entries in advance. Give each ticket or entrant a number before you draw, and keep the list.
  • Draw in public. Share your screen or project the generator so everyone sees the result appear.
  • Keep a record. Copy the results and paste them into your notes or an email straight after the draw.
  • Do not redraw because you dislike the result. A draw is only fair if the first result stands.

Choosing the right tool

Frequently asked questions

Are the minimum and maximum included?

Yes. A range of 1 to 10 can produce both 1 and 10, and every number in between with equal probability.

How do I make sure no number repeats?

Tick No duplicates (available for whole numbers). Each number can then appear at most once, like drawing balls from a bag without replacement.

Can someone predict the next number?

No. The numbers come from your browser's cryptographically secure generator, which is designed so that past results give no information about future ones.

How many numbers can I generate at once?

Up to 10,000 in one go. With No duplicates on, you are also limited by the size of the range.

Share

Try it yourself

Run your own numbers with our free tool: Random number generator. No sign-up, and it works on any device.

Open the calculator