Random Number Generator
Pick one or many random whole numbers in any range, with optional no-repeats and sorting.
Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.
About this tool
Generates random whole numbers between a minimum and a maximum, both ends included. Make one number or up to 10,000 at a time. Switch on 'no repeats' for unique draws such as lottery lines, raffle tickets or a random sample of row numbers, and sort the output if you want it in order. Numbers come from your browser's cryptographic random generator using rejection sampling, which avoids the small bias a plain modulo introduces, so every value in the range is exactly equally likely. Ranges can be negative and span up to about 9 quadrillion.
When to use it
Questions
Are the numbers truly random?
They come from crypto.getRandomValues, the same cryptographically secure generator browsers use for encryption keys. It is seeded from the operating system's entropy, which makes it unpredictable in practice and far stronger than Math.random.
Are the minimum and maximum included?
Yes. A range of 1 to 6 can return 1, 2, 3, 4, 5 or 6, each with the same one-in-six chance.
How does 'no repeats' work?
Each number can appear at most once in the batch, like drawing numbered balls from a bag without putting them back. You can't ask for more unique numbers than the range holds. Asking for 11 unique numbers between 1 and 10 shows an error instead of looping forever.
Can it generate decimals?
No, it produces whole numbers only. For a random decimal, generate a whole number in a scaled range and divide. For example, a number between 0 and 1000 divided by 100 gives a value from 0.00 to 10.00 in steps of 0.01.