🔢 Random Number Generator

Pick a minimum and maximum (inclusive) and how many numbers you need.

What the range means, and where the numbers come from

Both ends are included, so the count of possible values is one more than the gap between them:

range = max - min + 1
value = min + a whole number from 0 to range - 1

1 to 100 is 100 possibilities at 1% each, not 99. The draw uses crypto.getRandomValues with a rejection loop - values that would not divide evenly across the range are thrown away and redrawn - so no number is even slightly favoured. Negative minimums are fine (-50 to 50 is 101 values); decimals are not, since every input is read as a whole number.

The no-repeats tick changes the method, not just the filter

Left off, every number is drawn independently, so repeats happen far sooner than people expect - ten draws from 1 to 100 contain a duplicate 37.2% of the time. Ticked, the tool shuffles the entire range and deals off the top, which guarantees uniqueness and refuses outright if you ask for more numbers than the range holds.

No repeats builds the whole range in memory first, so ticking it with a range of millions will make the page pause. Leave it off for huge ranges, where collisions are vanishingly unlikely anyway.

Frequently asked questions

How do I get a random number between 1 and 100?

That is the default: leave Minimum at 1 and Maximum at 100 and press Generate. Every value from 1 to 100 has exactly a 1% chance, 100 included.

Can it generate decimals?

Not directly - it works in whole numbers. For two decimal places, generate from 0 to 999 and move the point two places yourself, so 472 becomes 4.72.

Why does the same number keep appearing?

Independent draws repeat. Over a range of 100, a run of 10 has a better than one in three chance of containing a pair. Tick No repeats if you need each number once.