Math
Random Number Generator
Enter your details
Runs in your browser
How to use it
Using the random number generator
- 01
Set the range
Minimum and maximum, both inclusive whole integers.
- 02
Choose quantity and repeats
One to one hundred numbers; uniqueness optional but common for raffles.
- 03
Read your numbers
Sorted in the “Your numbers” row; rerun for another draw whenever you like.
Good to know
Where random numbers earn their keep
Lottery lines, giveaway winners, sampling survey respondents, shuffling practice problems, picking who presents first; fair selection removes both bias and the appearance of it.
Unique versus independent
Lottery balls are drawn without replacement (unique mode); dice rolls repeat freely. Choosing the wrong style quietly changes your odds, so match the draw mechanics of whatever you are simulating.
A note on security
Math.random is fast and fine for games and demos but predictable to determined attackers. Passwords, tokens and cryptographic keys need dedicated CSPRNGs; never this tool.
How it's calculated
The math behind this calculator
Pick = min + floor(random() × (max − min + 1)) per drawEach draw maps the platform’s uniform Math.random() onto your integer range. Unique mode keeps a set of already-drawn values and redraws collisions until the requested count is met; feasible only when the count fits inside the range, which is validated up front. Results arrive sorted ascending for easy checking.
Assumptions & limitations
- Randomness comes from the platform’s Math.random; not cryptographically secure.
- Both range endpoints are inclusive.
- Unique draws require the range to contain at least as many integers as picks.
Worked example
Five unique lottery-style picks between 1 and 69; press calculate again for a fresh draw each time.
FAQ
Frequently asked questions
- Can I get the same numbers twice?
- Yes; every run is an independent draw; press calculate repeatedly until you like what you see.
- Why did unique mode fail?
- You asked for more unique numbers than the range contains integers; widen the range or lower the count.
- Is this safe for passwords or keys?
- No. Use a cryptographic random source for anything security-sensitive.
- Are the endpoints included?
- Yes; minimum and maximum can both appear among the results.
Keep exploring