How to generate random numbers
- Enter the lowest and highest numbers allowed.
- Enter how many numbers you need.
- Tick All different for a draw with no repeats.
- Tick Sort the results if you want them in order.
- 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
| Use | Settings to pick |
|---|---|
| Raffle or giveaway | Ticket range with all different on |
| Random sample of rows | Row range with all different and sort on |
| Team or speaking order | 1 to group size with all different on |
| Test data | Any range with repeats allowed |
| Dice roll | 1 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.