Random Number Generator
Pick one or many random numbers between a minimum and a maximum, for draws, games, samples or tests. Every value in the range is equally likely.
1 to 10,000
Numbers come from your browser’s cryptographically secure random generator (crypto.getRandomValues), with rejection sampling so no value is favoured. Nothing is sent or stored.
About Random Number Generator
Random Number Generator picks numbers between a minimum and a maximum that you choose. It can return one number or up to 10,000, as whole numbers or with up to 10 decimal places, with or without repeats, and either in the order drawn or sorted. Both ends of the range are included.
When to use it
- Running a raffle, a classroom draw or a giveaway.
- Rolling dice for a game.
- Choosing a random sample of rows, pages or survey responses to check.
- Producing test data for a spreadsheet or a program.
Worked example
To roll a die, set the minimum to 1, the maximum to 6 and how many to 1. Each press of Generate gives one of the six values, each equally likely.
To draw six different numbers from 1 to 49, set how many to 6 and untick “Allow repeats”. Choose “Smallest first” if you want them in order, then use “Copy all” to paste them elsewhere, one per line.
Asking for more different numbers than the range holds is an error. With a range of 1 to 5 and 6 numbers without repeats, the tool explains that only 5 different values are possible.
For decimals, choose the number of decimal places. With 0 to 1 and one decimal place, every result is one of 11 values: 0.0, 0.1 and so on up to 1.0.
How it stays fair
The numbers come from crypto.getRandomValues, the secure random source built into your browser, not from Math.random. A common shortcut, taking the remainder of a large random number, makes some values slightly more likely than others. This tool uses rejection sampling instead: any draw that would cause that bias is thrown away and drawn again, so every value in the range has exactly the same chance.
Good to know
- Results are never sent or stored. Copy them before you generate again.
- For official lotteries and regulated prize draws, follow the rules that apply to you.
- For passwords, use the Password Generator.
How to use Random Number Generator
- Enter the minimum, the maximum and how many numbers you need.
- Choose decimal places, whether repeats are allowed and the order.
- Press Generate, then copy the results.
Privacy: how it works
Numbers are generated in your browser by its secure random generator. They are not sent or stored.
Frequently asked questions
Are the numbers truly random?
They come from crypto.getRandomValues, the cryptographically secure generator built into your browser. Rejection sampling is used instead of a simple remainder, so no value in the range is more likely than another.
Are the minimum and maximum included?
Yes. With 1 to 6 you can get 1, 2, 3, 4, 5 or 6. With decimals, values are drawn in steps of the chosen precision, so 0 to 1 with 1 decimal place gives one of 11 values from 0.0 to 1.0.
Why do I get an error when repeats are off?
Without repeats every number must be different, so you cannot ask for more numbers than the range holds. 1 to 5 holds only 5 different whole numbers.