Random Number Generator
Draw whole numbers or decimals in any range, with or without repeats.
Random Number Generator: the tool
Settings
From 1 to 1,000.
Each number appears at most once.
Result
Choose your settings and press Generate. Nothing is drawn until you do.
Choose the smallest and the largest number, how many you want, and press Generate. Draw one number for a game, a hundred for a sample, or a set of different numbers for a raffle. Both ends of the range can be drawn, and nothing leaves your browser.
How it works
Numbers come from your browser's cryptographic random generator, which is unpredictable and has no pattern to learn. A common shortcut, taking the random value modulo the size of the range, makes some numbers slightly more likely whenever the range does not divide evenly into the generator's output. This tool avoids that: values from the uneven tail are thrown away and drawn again, so every number in the range is exactly as likely as any other.
Decimals are drawn as whole numbers of small steps and divided afterwards, so with two decimals every multiple of 0.01 in the range has the same chance. With no repeats, the tool shuffles the possible numbers and takes the first few, or, for a huge range, draws again on the rare collision. Either way, each number can appear at most once.
The range is checked before anything is drawn. If you ask for more different numbers than the range holds, you are told how many are possible instead of getting a short list. Results can be listed as drawn, smallest first or largest first, and copied with a comma, a space or a new line between them.
How to use it
- Type the smallest and the largest number. Both can be drawn.
- Choose how many numbers you want, and whether they are whole numbers or decimals.
- Tick Never repeat a number if every result must be different, and choose an order if you want the list sorted.
- Press Generate, then copy the result. Press Generate again for a fresh draw.
Example
Five different numbers from 1 to 49, the kind of draw you would make for a raffle or a game. The sequence is fixed so that this example is repeatable, which is not the case for your own draws.
What was set
- Range
- 1 to 49
- How many
- 5, never repeating, smallest first
What came out
- Numbers
- 17, 20, 23, 26, 47
Good to know
- You can draw from 1 to 1,000 numbers at a time, between -1,000,000,000,000,000 and 1,000,000,000,000,000, with up to 6 decimal places.
- With very large numbers and many decimals together, the values would exceed the exact whole numbers a browser can handle. The tool tells you to narrow the range or use fewer decimals instead of rounding silently.
- The results are random but not certified. Do not rely on them for a lottery, a gambling game or any draw that has to be audited.
Questions people ask
Are the numbers truly random?
They come from the generator that browsers provide for cryptography, which is designed to be unpredictable. That is stronger than the simple generators most programs use for games. It is not a physical source of randomness, and it is not certified for lotteries.
Can the same number come up twice?
Yes, unless you tick Never repeat a number. Drawing numbers is like rolling a die over and over: each draw ignores the ones before it, so repeats are normal and a sign of fair randomness.
Are the smallest and the largest number included?
Yes. A range from 1 to 6 can give 1 and can give 6, each with exactly the same chance as 2, 3, 4 and 5. With decimals, both ends are included as long as they are multiples of the step you chose.
How do I draw lottery-style numbers?
Set the range, for example 1 to 49, ask for the number you need, such as 6, and tick Never repeat a number. Then choose Smallest first to read them in order. This site is for fun and games, and it is not connected to any lottery.
Why does it refuse my settings?
The message under the field says why. Typical causes are a smallest number above the largest, a range that holds no number with that many decimals, or a request for more different numbers than the range contains.