Generate random numbers within a custom range, with or without duplicates.
Google AdSense Banner
This area will contain advertisements after approval.
Google AdSense Banner
This area will contain advertisements after approval.
This tool generates random whole numbers within a range you specify (a minimum and maximum value), using your browser's built-in random number function. You can choose how many numbers to generate at once, and whether duplicate numbers are allowed in the results.
When duplicates are allowed, each number is picked independently, so the same value can appear more than once, similar to rolling a die multiple times. When duplicates are disallowed, each number can only appear once, similar to drawing raffle tickets or lottery numbers without replacement, which requires the range to contain at least as many values as the count requested.
Say you set minimum 1, maximum 49, count 6, and disallow duplicates, like picking lottery numbers. Since every draw is random, the exact 6 numbers will differ each time you run it, but internally the tool builds the full pool of 49 numbers, shuffles it (a Fisher-Yates shuffle, giving every number an equal chance of any position), then takes the first 6 from the shuffled pool, guaranteeing no repeats. Try the same range with duplicates allowed instead, and each of the 6 numbers is picked independently, so seeing the same number twice (like two 23s) becomes possible.
Using this tool's output for anything security-sensitive, like generating a password or cryptographic key, it uses the browser's general-purpose random function, not a cryptographically secure source, use our Password Generator for that instead.
Requesting more unique numbers than the range allows and expecting the tool to silently expand the range, disallowing duplicates caps your count at the number of values actually in the range (e.g. at most 49 unique numbers from a 1-49 range), you'll get an explanatory error instead.
Assuming allowing duplicates and disallowing duplicates just differ in likelihood, they're fundamentally different processes, with duplicates allowed each number is independent, without duplicates the pool shrinks as numbers are drawn, closer to drawing raffle tickets than rolling dice.
Numbers are generated using your browser's built-in random number function, which is suitable for general purposes like games, raffles and sampling, but not for cryptographic or security-critical uses.
If you disable duplicates and request more numbers than exist in your chosen range, the tool will show an error explaining the range is too small for that count.
Google AdSense Banner
This area will contain advertisements after approval.