Random Number Generator

Set a minimum and maximum, choose how many numbers you want, and press Generate.

Result
—

How to use

  1. Set Minimum and Maximum. Both ends are included, so 1 and 100 can both come up.
  2. Enter How many numbers to draw (up to 100) and tick No repeats if each number may appear only once.
  3. Press Generate, then use the copy button next to the Result to copy the numbers.

About this tool

How the numbers are drawn

Each number comes from crypto.getRandomValues, the cryptographic random source built into every modern browser, rather than the older Math.random. A 32-bit random value is scaled to your range, so every whole number from the minimum to the maximum, both included, has the same chance. For a range like 1 to 100, the rounding difference between numbers is less than one in ten million and has no practical effect.

Numbers are listed in the order they were drawn, not sorted. If you enter the range backwards, with a minimum larger than the maximum, the tool simply swaps them.

Repeats or no repeats

With No repeats ticked, every number in the result is different, like drawing numbered slips from a hat without putting them back. That's what you want for assigning seats, choosing raffle tickets or picking 6 numbers from 1 to 49 for a lottery-style draw. If you ask for more numbers than the range holds, say 20 numbers between 1 and 10, you get each number once: 10 numbers in random order.

Untick it to allow repeats. Ten numbers from 1 to 6 with repeats allowed is the same as rolling a six-sided die ten times.

Handy settings

  • 1 to 6: a single die. 1 to 20: a twenty-sided die for tabletop games.
  • 1 to the class size: pick a student, or set How many to the class size with No repeats to get a random order for presentations.
  • 1 to the number of entries: choose a giveaway winner fairly from a numbered list.

Randomness has no memory

Every draw is independent. A number that just came up is exactly as likely to appear again, and no number is ever "due". Past results tell you nothing about the next one.

Frequently asked questions

Is this random number generator truly random?

It uses crypto.getRandomValues, the browser's cryptographically secure random source, which is good enough for security keys. Every number in the range is equally likely for practical purposes.

Are the minimum and maximum included?

Yes. With a range of 1 to 100, both 1 and 100 can be drawn.

How do I pick several numbers without duplicates?

Set How many to the count you need and tick No repeats. Every number in the result will be different.

Why did the same number come up twice in a row?

Each draw is independent, so repeats happen by chance. With a range of 1 to 100, the chance that the next number matches the previous one is 1 in 100.

How many numbers can I draw at once?

Up to 100 per press of Generate. With No repeats on, you can't get more numbers than the range contains.