Random Number Generator
Set the range and how many numbers you want. Toggle 'no repeats' for a draw or shuffle.
With or without replacement
With replacement (repeats allowed) is like rolling a die repeatedly — every roll is independent and numbers can recur.Without replacement (no repeats) is like a lottery draw or dealing cards — each number can appear at most once, so the pool shrinks as you go.
For a fair shuffle of 1..N, set the range to 1..N, the count to N, and tick "no repeats".
Common uses
- Dice / coin — range 1–6 or 1–2, count 1.
- Pick a winner — number entrants 1..N, count 1 (or several with "no repeats").
- Random sample — range 1..N, count = sample size, "no repeats" on.
- Shuffle a list — range 1..N, count N, "no repeats" on; use the order returned.
- Lottery numbers — set the range to the game's pool, count to how many are drawn, "no repeats" on.
Why "no modulo bias" matters
A naive random() % range makes the lower values of the range slightly more likely whenever the range doesn't divide evenly into the generator's period. This tool rejects and re-draws the rare out-of-bounds values instead, so every number is exactly equally likely.
Related tools
Frequently asked questions
How random is it?
What does 'no repeats' do?
Can I use this for a giveaway or raffle?
Are the numbers inclusive of both ends?
Is this suitable for a prize draw or raffle?
How is it random?
Can it generate random decimals or letters?
Last reviewed: September 2026. Figures and formulas are checked against their published sources; see the site's data notes.