CalcStack — free, instant, no signup. The interactive calculator loads automatically.

Random Number Generator

Crypto-grade randomness with rejection sampling — fair enough for raffles, classrooms, and tabletop critical hits. No-repeat mode included.

Most random number generators quietly cheat: Math.random plus modulo arithmetic biases low numbers. This one uses the browser's cryptographic random source with rejection sampling, so every value in your range is exactly equally likely — the difference matters when a raffle prize or a draft pick is on the line. Draw one number or a hundred, with optional no-repeat mode for picking winners.

Why people use this

Teachers raffling prizes and DMs rolling damage use it: crypto-grade randomness, no-repeat mode, any range — with dice odds baked in (2d6 sums to 7 on 16.7% of rolls).

How it works

  1. Set the min and max of your range.
  2. Choose how many numbers to draw.
  3. Turn on no-repeat mode for raffles and draft orders.
  4. Hit generate — results show sum, min, max, and mean.
  5. For dice: d6 is min 1 max 6; 2d6 needs two draws and sums to 7 on 16.7% of rolls.

Common questions

Is this random number generator actually fair?

Yes — and the reason is worth understanding, because most web generators are not. The naive approach (Math.random() × range, rounded) has two flaws: Math.random is a pseudorandom generator not designed for fairness under scrutiny, and the modulo shortcut biases toward low numbers when the range does not evenly divide the generator's output space. This tool uses crypto.getRandomValues — the same source that secures encryption keys — plus rejection sampling, which discards any raw value that would skew the distribution. Result: every integer in your range has exactly 1/n probability. For classroom picks and giveaway winners it is overkill in the right direction; for legal lotteries you still need certified hardware, but nothing on the web gets closer without one.

How do I simulate dice with a random number generator?

One die: min 1, max 6, draw 1. Multiple dice: draw that many numbers and read the sum shown below the results. The probabilities that make tabletop players smart: a single d6 is flat — each face 16.67% — but 2d6 is a bell curve: 7 appears on 6 of 36 combinations (16.7%), while 2 and 12 appear once each (2.8%). This is why Settlers of Catan hexes labeled 6 and 8 (five combinations each) are the valuable ones, and why casino craps is built on the same curve. Advantage rolls in D&D (roll twice, keep higher) shift a d20's average from 10.5 to about 13.8 — the generator's bulk-draw mode lets you see that distribution yourself in 100 rolls.

What is the no-repeat mode for?

Raffles, draft orders, bingo calls, and classroom cold-calling — any draw where each item can only win once. Technically it is sampling without replacement: the generator keeps a ledger of drawn values and rejects duplicates, which is exactly how pulling names from a hat works. Two constraints to know: the draw count cannot exceed the range size (you cannot pick 30 unique winners from 20 entries), and no-repeat draws are not independent — each draw slightly changes the odds for the rest, which is the point. For team assignments, draw the full no-repeat list equal to your roster size, then deal the first n to team A, next n to team B — a provably fair split that ends the "you rigged it" debate before it starts.

Browse all 500+ free calculators →