On this page
Formula
x = min + k × step, where k is a uniform random whole number from 0 to (max − min) ÷ step
- min, max
- the inclusive lower and upper limits
- step
- 1 for whole numbers, or 0.1, 0.01 and so on for decimals
- k
- an integer drawn with equal probability for every possible value
How the random number generator works
Set a minimum, a maximum and how many numbers you want, then press Calculate. Each number is chosen so that every value in the range has exactly the same chance. Press the button again for a fresh set.
The generator runs entirely in your browser. It asks the browser’s cryptographic random source for 53 random bits at a time and maps them onto your range. Simply taking a random number modulo the size of the range makes low values slightly more likely. Here, draws that would cause that bias are thrown away and redrawn, a technique called rejection sampling. The result is an exactly uniform pick.
How to use it
- Enter the range. Both limits are included, so 1 to 6 behaves like a die. Negative numbers work too.
- Choose how many. Pick 1 for a single number, or up to 1,000.
- Choose whole numbers or decimals. Decimal modes generate values at a fixed number of places, such as 2 places for prices or 6 for coordinates.
- No repeats makes every number in the result different.
- Sort lists the result from smallest to largest, which helps when checking raffle tickets.
Below the numbers you’ll see the effective range, how many values were possible, and for larger draws the smallest, largest and sum.
With repeats or without?
Drawing with repeats is like rolling a die several times: each roll is independent, and the same number can appear again. Drawing without repeats is like pulling tickets from a hat: once a number is drawn it’s out.
Repeats turn up sooner than intuition suggests. This table shows the chance of at least one duplicate when drawing whole numbers from 1 to 100 with repeats allowed. It’s the same arithmetic as the birthday problem.
| Numbers drawn | Chance of at least one repeat |
|---|---|
| 5 | 9.65% |
| 10 | 37.18% |
| 13 | 55.72% |
| 20 | 86.96% |
| 30 | 99.22% |
So if you need ten distinct winners, tick No repeats rather than relying on luck. You can work out similar odds with the probability calculator.
Random decimals
Decimal mode treats the range as a grid of evenly spaced values. From 0 to 1 at 2 places there are 101 possible results, 0.00, 0.01 and so on up to 1.00, and each one is equally likely. At 6 places there are 1,000,001. This makes the endpoints reachable and keeps every value at a fixed precision, which is usually what you want for prices, measurements or test data. If you enter a limit with more decimals than the chosen precision, such as 2.345 at 2 places, it’s moved inward to 2.35 so results never fall outside your range.
Fairness and record keeping
A draw is only as fair as the process around it. Number your entries before you generate, so nobody can choose which entry gets which number after seeing the result. Generate once, in front of witnesses or on a screen recording if the stakes are real, and copy the result straight away. Because there’s no seed, the same draw can’t be reproduced later, which is the point: nobody can calculate the outcome in advance.
Real-life uses
- Raffles and giveaways. Number the entries, then draw winners with No repeats. Keep a copy of the result as a record.
- Games and classrooms. Roll virtual dice, pick who goes first, or call on a random student.
- Random sampling. To survey 50 customers from a numbered list of 2,000, draw 50 numbers from 1 to 2,000 without repeats. The number of different samples possible is C(2,000, 50), which the combination calculator can count exactly.
- Assigning groups. Shuffle numbers 1 to n and split the list to form random teams or treatment groups.
- Testing and simulation. Decimal draws give quick test data or Monte Carlo inputs. Check the spread with the average calculator.
Common mistakes
- Expecting even spread in small draws. Ten draws from 1 to 10 almost never produce each number once. Uneven results are normal randomness, not a fault.
- Excluding an endpoint by accident. Both limits are included. For “a number under 100”, set the maximum to 99.
- Asking for more unique numbers than exist. Ten different whole numbers from 1 to 5 is impossible, and the generator will say so.
- Using decimals for counts. People, tickets and dice need whole numbers; leave the type set to whole numbers.
- Reusing a draw. For fairness, generate once and record the result instead of regenerating until you like the outcome.
Glossary
- Uniform distribution: every value in the range is equally likely.
- Without replacement: a value drawn can’t be drawn again, the No repeats option.
- Seed: a starting value that makes a pseudorandom sequence repeatable. This tool doesn’t use one, so draws can’t be replayed.
- Cryptographically secure: unpredictable even to someone who has seen earlier outputs.
Worked examples
A range with a single possible value
Edge case: when the minimum equals the maximum, the only possible result is that number.
Inputs: Minimum = 7; Maximum = 7; How many numbers = 1; Number type = Whole numbers (integers)
Each number is drawn uniformly from the 1 possible value from 7 to 7.
Answer: Random number from 7 to 7: 7
Several draws from a one-value decimal range
Three draws with repeats allowed between 2.5 and 2.5 at one decimal place.
Inputs: Minimum = 2.5; Maximum = 2.5; How many numbers = 3; Number type = Decimals, 1 place
Each number is drawn uniformly from the 1 possible value from 2.5 to 2.5 in steps of 0.1.
Answer: Random numbers from 2.5 to 2.5: 2.5, 2.5, 2.5
No-repeat draw that uses every value
With repeats off, the count can be at most the number of possible values, here exactly one.
Inputs: Minimum = 4; Maximum = 4; How many numbers = 1; Number type = Whole numbers (integers); No repeats (every number different) = Yes
Each number is drawn uniformly from the 1 possible value from 4 to 4, without repeats.
Answer: Random number from 4 to 4: 4
Assumptions and limitations
- Numbers are generated in your browser with crypto.getRandomValues, the cryptographically secure generator of the Web Crypto API. If a browser lacks it, Math.random is used instead. Nothing is sent to a server.
- Both limits are inclusive, and every possible value is equally likely. Rejection sampling removes the small bias that the common "random modulo range" shortcut introduces.
- Decimals are drawn from the evenly spaced values at the chosen number of places, such as 0.01 steps for 2 places. If a limit has more decimals than that, it's rounded inward to the nearest allowed value.
- In whole-number mode, decimal limits are rounded inward too, so 1.5 to 10.5 gives whole numbers from 2 to 10.
- Up to 1,000 numbers can be generated at once, with limits between −1,000,000,000,000 and 1,000,000,000,000.
- With No repeats ticked, every number in the result is different, so the count can't exceed the number of possible values.
- Results change on every run and aren't stored. The worked examples use ranges with a single possible value so their results are fixed.
Frequently asked questions
Are these numbers truly random?
They come from your browser's cryptographically secure generator, which is seeded from hardware and operating-system entropy and is suitable for encryption keys. Strictly speaking it's a pseudorandom generator, but its output can't be predicted or distinguished from true randomness in practice.
How do I pick a random number from 1 to 100?
Enter 1 as the minimum and 100 as the maximum, leave the count at 1 and select whole numbers. Both 1 and 100 can come up, each with a 1 in 100 chance.
How do I generate numbers with no repeats?
Tick No repeats. The generator then draws without replacement, like pulling numbered balls from a bag without putting them back. Use it for raffles, lottery-style picks or choosing a random sample.
Why did I get the same number twice?
With repeats allowed, each draw is independent, so duplicates are normal. Drawing just 13 numbers from 1 to 100 gives better-than-even odds of at least one repeat. Tick No repeats if every number must be different.
Can I shuffle a list from 1 to n?
Yes. Set the minimum to 1, the maximum to n and the count to n, with No repeats ticked and sorting off. The result is a random ordering of every number from 1 to n.
Can I reproduce the same numbers later?
No. There's no seed to reuse, by design. Copy the result if you need a record, for example to prove a raffle draw.
Sources
- Crypto: getRandomValues() method — MDN Web Docs. Checked October 12, 2026.
- Web Cryptography Level 2 — World Wide Web Consortium (W3C). Checked October 12, 2026.
- Math.random() — MDN Web Docs. Checked October 12, 2026.