Skip to content

Generators

Random Number Generator

Generate one or many random numbers between any minimum and maximum. Choose how many you need and toggle 'no repeats' for unique draws — great for raffles, games and sampling.

Generators · Random Number GeneratorRuns in your browser

How to generate random numbers in a range

  1. Enter the Minimum and Maximum. The fields start at 1 and 100; negative values are fine, and decimals are rounded inwards (a minimum of 2.5 becomes 3, a maximum of 10.7 becomes 10).
  2. Set How many. It defaults to 1, anything below 1 or left blank is treated as 1, and the field is capped at 10,000 per draw.
  3. Tick No repeats (unique numbers) if the same value must not come up twice in one draw.
  4. Click Generate. The results appear as highlighted chips, and Copy results places them on the clipboard separated by commas.

How a number is drawn

For every number the tool requests one unsigned 32-bit integer from crypto.getRandomValues, the Web Crypto API's secure generator, and maps it into your range with min + (value mod range size). A range of 1 to 100 has 100 possible values, so the raw 32-bit number is reduced modulo 100 and 1 is added. Math.random is never used.

Because 2^32 is not divisible by most range sizes, this mapping has a modulo bias. For the range 1 to 100, 4,294,967,296 mod 100 is 96, so the values 1 to 96 can each be produced by 42,949,673 raw numbers while 97 to 100 get 42,949,672. The relative difference is about 2 parts in 100 million. The bias grows with the range size, as the table shows, but for any range a person would type by hand it is immeasurably small.

Range size2^32 mod sizeRelative bias
6 (a die)41 in 716 million
100961 in 43 million
1,0002961 in 4.3 million
1,000,000967,2961 in 4,294 (0.023%)

Modulo bias by range size (favoured values are more likely by this fraction)

What No repeats does differently

With the box ticked, the tool draws numbers one at a time and keeps each new value in a set, throwing away any that has already come up, until it holds as many as you asked for. Each result is an equally likely selection without replacement, which makes it a correct lottery-style draw: 6 unique numbers from 1 to 49 give the same distribution as pulling balls from a drum.

Because nothing but the drawn values is stored, a huge range in unique mode costs no more than a small one: 10 unique numbers from 1 to 100,000,000 appear instantly. Only when you ask for more than half the range (say 90 unique values from 1 to 100) does rejection become wasteful, so the tool then switches to listing the range and running a partial Fisher–Yates shuffle, which at that point is at most twice the size of the count and so is always small.

Error messages and what causes them

A range of 3.2 to 3.8 looks valid but rounds to a minimum of 4 and a maximum of 3, which triggers the first message. A blank Minimum is read as 0, so leaving it empty draws from 0 upwards rather than failing.

MessageCauseFix
Max must be greater than or equal to min.The maximum is below the minimum after rounding, or a field is not a numberSwap the values or correct the typo
Not enough numbers in range for that many unique values.No repeats is on and How many exceeds the count of integers in the rangeWiden the range, lower the count or untick No repeats
How many is capped at 10,000 numbers per draw.How many is above 10,000Lower the count, or run several draws

Settings for common draws

NeedMinimumMaximumHow manyNo repeats
A 6-from-49 lottery line1496On
Roll a single d6161Off
Pick 3 winning raffle tickets from 1000 to 1999100019993On
A random page of a 350-page book13501Off
Random percentage01001Off
Order 20 participants (as positions)12020On

Limits of this random number tool

  • Integers only; there is no decimal-places setting. For two decimal places, draw from 0 to 10,000 and divide by 100.
  • Results are shown in the order drawn and are not sorted.
  • No seed and no reproducibility: the same settings never give the same sequence twice, by design.
  • How many stops at 10,000 per click, a limit chosen so the chips still render quickly; larger samples need several draws.
  • Nothing is saved between visits, so copy results you need to keep.

Frequently asked questions

Are the numbers truly random?

We use your browser's cryptographically secure random source (the Web Crypto API), which produces high-quality unpredictable numbers — far better than a simple pseudo-random function for raffles and draws.

Can I generate numbers with no duplicates?

Yes. Turn on 'No repeats' and every number in the result will be unique, as long as the range is large enough to hold the quantity you asked for.

Can it produce decimal numbers?

No. Both bounds are rounded to whole numbers and every result is an integer. Scale the range up and divide afterwards if you need decimals.

What happens if I type 2.5 as the minimum?

The minimum is rounded up to 3 and the maximum is rounded down, so the draw only ever covers whole numbers that lie inside the bounds you typed.

Why do I see 'Not enough numbers in range for that many unique values'?

With No repeats on, you asked for more values than the range contains, for example 10 unique numbers between 1 and 5. Widen the range or ask for fewer.

Is it fair enough for a prize draw?

Yes. Each result comes from the operating system's cryptographic random source with a bias of a few parts per hundred million, and unique mode draws without replacement exactly as a physical drum would.

Explore

113 tools. Zero uploads. One place.

Every tool opens instantly, works on your phone and keeps your files on your device.