Random Number Generator

This random number generator draws whole numbers in any range you choose. It uses secure randomness and rejection sampling. So every number in the range has a truly equal chance. The obvious way to code it does not achieve that.

Your files never leave this device

Generate random numbers Unbiased · Up to 10,000

Inclusive, this number can be drawn.

Inclusive, this number can be drawn.

Up to 10,000 at a time.

How to generate random numbers

  1. Enter the lowest and highest numbers allowed.
  2. Enter how many numbers you need.
  3. Tick All different for a draw with no repeats.
  4. Tick Sort the results if you want them in order.
  5. Press Generate and copy the list.

What this random number generator gives you

  • Secure randomness and not the predictable default.
  • Rejection sampling so every number has an equal chance.
  • A no repeats mode that shuffles the range exactly.
  • Up to 10000 numbers in one go.
  • Comma or line separated output.
  • A clear error when you ask for more unique numbers than exist.

Two ways to get random numbers wrong

Random numbers in a range look trivial. Two well known traps make output that looks random but is not fair.

The first trap is modulo bias. Take a random byte and divide by 100 for the remainder. It seems fine. But 256 does not divide evenly by 100. Values 0 to 55 can come from three different bytes. Values 56 to 99 come from only two. So the low numbers show up about 50 percent more often.

This random number generator uses rejection sampling. It throws away any value outside the largest clean multiple and draws again. That removes the bias completely.

The second trap hits unique numbers. Some tools draw again and again and skip repeats. Ask for 99 unique numbers from 1 to 100 that way. The last few draws take a huge number of tries. This tool shuffles the whole range instead. It is exact and finishes fast every time.

Where the randomness comes from

The browser crypto API draws on the random pool of your operating system. That matters when the result carries weight. Think of a prize draw, a team assignment or a data sample.

The ordinary Math.random follows a fixed formula. Someone with enough past output can predict what comes next. For picking a number in a game it makes no difference. For anything people might try to cheat it makes all the difference.

Common uses

UseSettings to pick
Raffle or giveawayTicket range with all different on
Random sample of rowsRow range with all different and sort on
Team or speaking order1 to group size with all different on
Test dataAny range with repeats allowed
Dice roll1 to 6 with one number

Real randomness does not look random

People often reject true randomness as suspicious. In a hundred coin flips a run of six heads in a row is more likely than not. Most people would call that rigged. In a draw of ten numbers from one to a hundred two numbers often land close together. That looks wrong too. It is normal.

The birthday problem shows this best. Put just 23 people in a room. The odds that two share a birthday pass 50 percent. Human gut feeling about chance is poor. So a proper generator beats numbers you pick yourself.

Can you use it for an official draw?

The randomness is sound. The tool keeps no audit trail though. Regulated contests and lotteries need a documented process. Many US states set rules for raffles and sweepstakes. Check your local rules before a public prize draw. For a classroom or office raffle this tool works well.

A quick random number generator example

You sold tickets numbered 1 to 250. You need three winners. Enter 1 and 250. Ask for 3 numbers. Tick all different. Press Generate. Read the three ticket numbers aloud. Take a screenshot so everyone can see the result later.

Tips for a fair public draw

  • Announce the number range before you draw.
  • Draw in front of the group or on a shared screen.
  • Save a screenshot of the result.
  • Decide ahead of time what happens if a winner does not respond.

Clear rules matter as much as fair numbers. People trust a draw when they see how it works. Tell everyone the plan first. Then run the draw once and stick with the result.

Who uses a random number generator?

Teachers pick students fairly. Event hosts run raffles. Researchers pick samples. Game hosts roll virtual dice. Developers create test data.

Your draws stay private

Your browser draws every number. No number goes to a server. Need random IDs? Use the UUID generator. Need a secure secret? Try the password generator. Want the average of your results? The average calculator helps.

Frequently asked questions

What is modulo bias?

A random byte divided by 100 for the remainder favors low numbers. They come up about 50% more often. Rejection sampling removes this.

Are the numbers truly random?

They come from the secure random source in your browser. That is far stronger than the ordinary Math.random.

Why does the no repeats mode have a limit?

You cannot draw 200 different numbers from a range of 100. The random number generator tells you instead of looping forever.

Why do my numbers look clustered?

Real randomness clusters. Runs and near repeats are normal. A lack of them would be suspicious.

Can I use this for an official prize draw?

The randomness is sound. The tool keeps no audit trail though. Regulated draws need a documented process.

Does the tool store my numbers?

No. Your browser does the work. Your results stay on your device.