What this calculator does
A random number generator draws values from a range with each outcome equally likely. The distinction that matters most is whether repeats are allowed: drawing without replacement, as a lottery does, is a different process from drawing with replacement, as a dice roll does.
Every value here is regenerated each time the calculator runs, so pressing reset or changing any input produces a fresh draw. The numbers in the worked examples below were generated when the page was built and will not match what you see in the tool: that is the nature of randomness rather than an error.
The formula
Unique draws use a pool that shrinks as values are taken, which guarantees no repeats. Draws with replacement scale a random fraction across the range independently each time. Both use the browser’s built-in generator, which is pseudorandom: deterministic given its internal state, but statistically indistinguishable from random for ordinary purposes.
| Term | Meaning |
|---|---|
| Without replacement | Each value can appear at most once. |
| With replacement | Values may repeat. |
| Pseudorandom | Generated by an algorithm, not a physical process. |
| Uniform | Every value in the range equally likely. |
The inputs explained
| Field | What to enter |
|---|---|
| Minimum | The lowest value that can be drawn, inclusive. |
| Maximum | The highest value, inclusive. |
| How many | How many numbers to draw. For unique draws this cannot exceed the size of the range. |
| Allow repeats | Whether repeats are allowed. Choose unique for lottery-style draws, repeats for dice-style rolls. |
When to use it
Drawing lottery-style numbers
Set the range and count to match the game and choose unique. Six from 45 is the common format, and every combination is equally likely.
Picking a winner fairly
Number your entrants and draw one. It is more defensible than choosing by eye, and demonstrably unbiased.
Sampling from a list
Selecting a random subset for quality checks or a survey. Unique draws prevent the same item being picked twice.
Simulating dice or coins
Allow repeats and set the range to match: 1 to 6 for a die, 1 to 2 for a coin. Repeats are essential here, since real dice have no memory.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
Sample draws from different ranges
Six unique numbers drawn from a range of upper limits. These particular values were generated when this page was built.
| Range | Numbers | Sorted | Sum · average |
|---|---|---|---|
| 1 to 10 | 1, 4, 10, 9, 5, 8 | 1, 4, 5, 8, 9, 10 | 37 · 6.17 |
| 1 to 20 | 13, 1, 8, 15, 17, 14 | 1, 8, 13, 14, 15, 17 | 68 · 11.33 |
| 1 to 45 | 16, 6, 45, 42, 5, 3 | 3, 5, 6, 16, 42, 45 | 117 · 19.50 |
| 1 to 50 | 16, 34, 47, 28, 1, 24 | 1, 16, 24, 28, 34, 47 | 150 · 25.00 |
| 1 to 100 | 22, 32, 76, 85, 14, 4 | 4, 14, 22, 32, 76, 85 | 233 · 38.83 |
| 1 to 1000 | 158, 792, 119, 992, 671, 87 | 87, 119, 158, 671, 792, 992 | 2,819 · 469.83 |
How many numbers you draw
Drawing increasing quantities from 1 to 100.
| Count | Numbers | Sum · average |
|---|---|---|
| 1 numbers | 29 | 29 · 29.00 |
| 3 numbers | 31, 83, 28 | 142 · 47.33 |
| 5 numbers | 18, 7, 81, 60, 36 | 202 · 40.40 |
| 8 numbers | 56, 36, 1, 73, 42, 79, 98, 97 | 482 · 60.25 |
| 12 numbers | 35, 6, 72, 9, 80, 89, 18, 16, 50, 48, 84, 14 | 521 · 43.42 |
Questions
Are these numbers truly random?
They are pseudorandom, generated by an algorithm from an internal seed. For games, sampling and everyday use this is entirely adequate. For cryptography or anything where an adversary might predict the output, a cryptographically secure generator is required.
Why do I get different numbers each time?
Because a new draw is made whenever the calculator runs. Changing any input or pressing reset triggers a fresh set: there is no fixed seed.
What is the difference between unique and repeating draws?
Unique draws remove each value from the pool once taken, like drawing balls from a bag. Repeating draws replace it, like rolling a die. Lottery numbers are unique; dice rolls are not.
Can I draw more numbers than the range allows?
Not with unique selected: there are not enough distinct values. The calculator falls back to allowing repeats in that case.
Is one set of lottery numbers more likely than another?
No. Every combination has exactly the same probability, including 1-2-3-4-5-6. Sequences that look patterned feel less likely but are not, which is one of the most robust findings in the psychology of probability.
For the odds of a given draw, see permutations and combinations or the probability calculator.