Random number generator

Set a range, choose how many numbers you want, and decide whether a number may come up twice. The result appears immediately and nothing is sent anywhere.

How to use

  1. 1.Set the minimum and the maximum. Both ends are included in the range.
  2. 2.Enter how many numbers to draw, and untick the repeat option if a number may appear more than once.
  3. 3.Press draw. Each press is a fresh draw, unrelated to the last.

Repeats, and why the option matters

With repeats off, drawing five numbers from 1 to 100 gives five different numbers — the right behaviour for picking winners, where one ticket cannot win twice. With repeats on, each number is drawn independently, which is what you want when simulating something like five dice rolls. Choosing the wrong one quietly changes the odds, which is why it is a visible tick box and not a hidden default.

How the numbers are generated

Every number comes from crypto.getRandomValues, the generator the browser also uses for cryptographic work, and values that would skew the range are discarded rather than folded back with a modulo. Without that discard, when the range does not divide evenly into the generator's output, the low numbers come up slightly more often. Across a draw of ten it is invisible; across thousands it is measurable.

Large ranges

Drawing without repeats uses whichever of two methods fits the shape of the request. When you want a large share of the range, it shuffles the range and takes the first few, which is exact. When you want a handful out of a huge range, shuffling would mean building a list of millions, so it draws numbers and discards the ones already seen. Same distribution either way, and the choice is made by comparing how many you asked for against the size of the range, not by a fixed cut-off — a fixed cut-off is how you end up shuffling two hundred thousand values to return one.

Specific uses

Frequently asked questions

Does the range include the minimum and maximum?

Yes, both ends are part of it. A range of 1 to 10 can return 1 and can return 10.

Can it generate decimals?

No, only whole numbers. Multiply your range by ten or a hundred, draw, then divide the result back if you need one or two decimal places.

Is it suitable for a lottery or a raffle?

The draw itself is sound. What a page like this cannot give you is a record somebody else can check, which is what a draw with a real prize needs.

Why did the same number appear twice?

Because repeats are allowed in that mode, and random genuinely does that. In a hundred draws from 1 to 10 you should expect plenty of pairs. Tick the repeat option off to prevent it.

Running a giveaway on an Instagram post?

The comment picker reads the post, counts the entries and produces a public verification page with a code anyone can open — things a list pasted by hand cannot prove. Free up to 100 comments.

Pick from comments