Random Number Generator
Pick one or many random numbers in any range you choose. Set the minimum and maximum, decide how many numbers you need (up to 20), choose integers or decimals, and control whether repeats are allowed. Your results appear instantly and a frequency chart shows how the picks are spread across the range. Useful for lotteries, sampling, games, decision-making, and teaching probability.
How this random number generator works
This tool uses your browser's built-in pseudorandom number generator, powered by the xorshift128+ algorithm that modern browsers implement. You set a minimum and maximum value and the generator picks numbers uniformly from that range, meaning every value has exactly the same probability of being chosen. For integers the formula is simply floor(min + random() x (max - min + 1)), clamped to [min, max]. For decimals the result is rounded to one or two decimal places before clamping. When you disable duplicates the generator uses a partial Fisher-Yates shuffle, drawing from a virtual pool of all possible values so no value can repeat. Each time any input changes the numbers regenerate automatically, giving you a fresh draw without clicking any button.
True random vs. pseudorandom numbers
Computers are deterministic machines, so they cannot generate truly random numbers from first principles. Instead they use pseudorandom number generator (PRNG) algorithms that produce sequences which pass statistical tests for randomness. For most everyday purposes, including lotteries, games, sampling, and simulations, a cryptographic-quality PRNG is indistinguishable from true randomness. True random number generators (TRNGs) derive entropy from physical phenomena such as atmospheric radio noise (RANDOM.ORG) or hardware thermal noise. TRNGs matter for cryptographic key generation, but for drawing a raffle winner or picking a random number from 1 to 100 a PRNG is perfectly adequate and far more convenient.
Probability and uniform distributions
When you generate a single integer between 1 and N, each integer has exactly a 1/N probability of being chosen. This is called a discrete uniform distribution. If you generate between 1 and 6, for example, the probability of any particular face is 1/6 (about 16.7%), exactly matching a fair die. When you draw multiple numbers without replacement, the probability shifts for each subsequent pick because the pool shrinks. The first pick has a 1/N chance for any value; the second pick has a 1/(N-1) chance for any remaining value, and so on. This is the same mathematics behind lottery odds: 6 balls drawn from 49 without replacement give 49!/(49-6)! / 6! = 13,983,816 possible combinations.
Practical tips for common tasks
For a lottery draw set the minimum to 1, the maximum to the highest ball number, the quantity to the number of balls, and disable duplicates. For a dice roll set the range to 1-6 and the quantity to the number of dice. For selecting a random sample from a numbered list set the range to 1 through the list length, set the quantity to your sample size, and disable duplicates, then match the output numbers to the corresponding list entries. For a coin flip use a range of 0 to 1 with integer mode: 0 = tails, 1 = heads. For a random decimal between 0 and 1 set the range to 0-1 with two decimal places.
Common random number generator uses
| Use case | Typical range | Allow duplicates? | Notes |
|---|---|---|---|
| Lottery ticket (6 of 49) | 1 to 49, qty 6 | No | Each ball drawn is unique |
| Dice roll (six-sided) | 1 to 6, qty 1 | Yes | Equal chance for each face |
| PIN selection | 0 to 9, qty 4 | Yes | Digits can repeat |
| Random survey sample | 1 to N, qty k | No | Each participant selected once |
| Statistical simulation | Any range | Yes | Many draws model a distribution |
| Raffle draw | 1 to ticket count | No | Winner cannot be drawn twice |
| Password character index | 0 to 61, qty 12 | Yes | Maps to a character set |
Examples of how different fields use random number generation, and the typical range settings.
Frequently asked questions
Are the numbers truly random?
They are pseudorandom, produced by the xorshift128+ algorithm in your browser. For everyday uses like games, sampling, and drawing winners this is statistically indistinguishable from true randomness. If you need numbers for cryptographic purposes, use a dedicated cryptographically secure source instead.
What does "no duplicates" mean?
When duplicates are disabled, each number in the result can only appear once, like drawing balls from a bag without putting them back. The range must contain at least as many distinct values as the quantity you request. If you ask for 10 unique integers from 1 to 5, the tool will cap the output at 5 (the size of the range).
How do I simulate a dice roll?
Set minimum to 1, maximum to 6, quantity to 1 (or more for multiple dice), number type to Integer, and allow duplicates. Each roll has an equal 1 in 6 chance for each face, the same as a physical die. For two dice set quantity to 2 and the sum of the two results gives you values from 2 to 12.
How do I generate lottery numbers?
Set the minimum to 1, maximum to the highest number in your lottery (e.g. 49 for a 6/49 game), quantity to the number of balls drawn (e.g. 6), and disable duplicates. Sort ascending to get a ticket-style result. For games with a bonus ball, generate the main draw first, then generate the bonus separately.
Can I generate random decimal numbers?
Yes. Select "Decimal (1 place)" or "Decimal (2 places)" from the Number type menu. The tool generates values in your range rounded to the chosen number of decimal places. To get a random probability between 0 and 1, set the range to 0-1 with two decimal places.
What is the maximum quantity I can generate at once?
This tool generates up to 20 numbers at once. For larger samples, simply note the results, change an input slightly to trigger a new draw, and repeat as needed.