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?
It uses crypto.getRandomValues with rejection sampling, so every value in the range is equally likely — no modulo bias.
What does 'no repeats' do?
It draws without replacement, like pulling numbered balls from a bag. You cannot ask for more unique numbers than the range contains.
Can I use this for a giveaway or raffle?
Yes. Number the entrants 1..N and draw one (or several unique) winners. For anything with money at stake, keep a screenshot or record of the inputs.
Are the numbers inclusive of both ends?
Yes. A range of 1 to 6 can return 1, 2, 3, 4, 5 or 6. Decimals in the min or max are rounded inward to the nearest whole number.
Is this suitable for a prize draw or raffle?
For informal draws, yes — number the entrants 1..N and generate the winners. For anything with money, legal or reputational stakes, use a documented process: record the entrant list, the exact range and count you entered, and a screenshot of the result, ideally with a witness. A dedicated audited randomness service is better for high-value draws.
How is it random?
It uses crypto.getRandomValues — the browser's cryptographically secure random source — with rejection sampling so every value in the range is exactly equally likely (no 'modulo bias' toward the low end of the range).
Can it generate random decimals or letters?
This tool does whole numbers only. For a random password or string, use the password generator; for a random pick from a list, number your items and draw an index here.

Last reviewed: September 2026. Figures and formulas are checked against their published sources; see the site's data notes.