Random Number Generator
Random integers in any range — unique or with repeats, sorted or in draw order.
Generate random numbers
Set a range, a count, and whether repeats are allowed.
A random number generator for lottery picks, sampling, test data and games. Set the minimum and maximum, choose how many numbers you need, and decide whether the same number may appear twice.
Unique mode
With Unique ticked, no number repeats — the equivalent of drawing balls from a bag without putting them back. This is what you want for lottery-style picks, random sampling without replacement, and assigning distinct IDs. If you ask for more numbers than the range contains, the tool caps the count and tells you, rather than silently repeating values.
Duplicates allowed
With unique mode off, every number is an independent draw. That means repeats are not just allowed, they are expected: picking 10 numbers from 1–10 with repeats will almost certainly produce duplicates. This is the right mode for simulating dice, sampling with replacement, or generating noisy test data.
What people use it for
- Lottery and raffle numbers: unique picks from a fixed range.
- Sampling: choosing survey participants or QA test cases.
- Games: random damage, loot tables, initiative order.
- Development: quick test data and randomised fixtures.
- Teaching: demonstrating uniform versus non-uniform distributions.
Uniform, not "random-looking"
Every value in the range has the same probability. The tool uses rejection sampling on top of
crypto.getRandomValues, which avoids the modulo bias that naive random-number code
introduces — so 1 and 100 are exactly as likely as 42, even at the edges of the range.
Frequently asked questions
What is the largest range I can use?
The inputs accept any integer range; the count is capped at 1000 results per run to keep the page responsive.
Can I get decimal numbers?
This generator produces integers only. For decimals, divide the result by 10, 100 or 1000 depending on the precision you need.
Why did it reduce my count?
In unique mode you cannot draw more numbers than the range contains, so the count is capped at the range size.
Does it avoid modulo bias?
Yes — values above the largest multiple of the range are rejected and redrawn, so every number is equally likely.