Random Number Generator
Generate random numbers in a range with options for quantity, duplicates, and sorting.
By Konstantin Iakovlev · Updated September 2026 · Source: MDN Web Docs — Math.random()
Generated Numbers
35, 51, 75, 18, 83
Count
5
Sum
262.00
Average
52.4
Use the Random Number Generator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.
Disclaimer: This calculator is for informational purposes only. Results are estimates based on the information you provide and the assumptions described on this page.
How It Works
Generating random numbers within a chosen range supports a surprisingly wide spread of tasks: drawing statistical samples for research, picking raffle winners, or simulating something like a lottery draw. It is not a tool for passwords or anything else that has to stay secret, for the reason explained below.
Under the hood, the tool uses your browser's built-in Math.random() function, a pseudorandom generator whose algorithm the JavaScript standard leaves to each browser. Each draw is scaled to a whole number between your minimum and maximum, both included, with every value equally likely. You set the minimum and maximum, how many numbers you want (1 to 100), and whether repeats are allowed; with repeats off, a value that was already drawn is simply drawn again. Turning Sort on lists the results in ascending order. Math.random() is not cryptographically secure, so for passwords or keys use a generator built on the Web Crypto API's crypto.getRandomValues().
Because the output is pseudorandom, it comes from a deterministic process, yet for nearly every practical purpose it behaves like genuine randomness. Where people go wrong is expecting a handful of draws to mirror the distribution of the full range. Five numbers from 1 to 100 will often bunch together or leave big gaps; that is ordinary sampling variation rather than bias, so interpret short sequences with appropriate caution.
Example: Drawing Raffle Numbers for a Charity Event
- 1 A charity is holding a raffle and needs 100 different winning numbers between 1 and 500, listed in ascending order for easy checking.
- 2 Enter Minimum = 1, Maximum = 500 and Quantity = 100 (the most the generator makes at once), set Allow Duplicates = No and Sort = Yes, then press Generate Numbers.
- 3 The calculator lists 100 different numbers in ascending order, for example 3, 17, 45, 88, ..., 489, 497, together with their count, sum and average. Your list will be different every time.
- 4 Each of the 500 numbers had the same chance of being picked. Copy or screenshot the list as the record of the draw, because pressing Generate again or changing any input produces a new set.
Source: MDN Web Docs — Math.random() · Last updated: September 2026
Frequently Asked Questions
How does a random number generator work?
Are online random number generators truly random?
How do you generate a random number between 1 and 100?
You might also need
Percentage Calculator
Calculate percentages three ways: what is X% of Y, X is what % of Y, and percentage change from X to Y.
Fraction Calculator
Add, subtract, multiply, and divide fractions. Results shown as fraction, mixed number, and decimal.
Standard Deviation Calculator
Calculate mean, variance, and standard deviation (population and sample) from a data set.