Math Tools
Random Number Generator
Pick one number or draw a list with or without repeats.
Go to calculatorResult
Generate numbers to see the result.
On this page
The method
How the random number generator works
Your browser supplies random bits through Web Crypto. The generator rejects the extra values that would otherwise favor some numbers in the range. When you choose No repeats, each draw removes the selected number from the remaining choices.
Example 1
Pick 5 unique numbers from 1 to 30
Suppose your classroom items are numbered from 1 through 30. Set the minimum to 1 and the maximum to 30. Enter a count of 5 and turn on No repeats. Use Draw order to keep the selection sequence or Smallest first to find the chosen items faster.
- Possible numbers
- 30
- One possible sorted sample
- 3, 9, 14, 23, 28
Example 2
Draw all the whole numbers from −2 to 2
The range has five whole numbers. With No repeats on, a draw of five contains every value once, in a random order. A draw of six needs a larger range or permission to repeat.
- Possible numbers
- −2, −1, 0, 1, 2
- Largest unique batch
- 5
Before you calculate
Assumptions & limits
- The range includes both endpoints. Enter signed or unsigned whole numbers up to 15 digits, using plain digits and an optional leading plus or minus.
- Draw 1 to 1,000 numbers at a time. With No repeats on, the range must contain at least as many values as you want to draw.
- The inputs and the result stay in this browser tab. The text and CSV downloads each store the current list in the displayed order.
- Use this generator for everyday picks, teaching and basic sampling. Follow any independent verification requirements that govern a regulated draw.
Keep in mind
Common mix-ups
Can a number appear twice?
Yes, if repeats are allowed. With No repeats on, a value can occur only once in each batch. A new batch can contain a value from an earlier batch.
What happens when the bounds are equal?
There is only one possible value. Draw it once with No repeats on or draw it as many times as you need with repeats allowed.
Does changing the order generate more numbers?
Changing order keeps the same selection. Choose Draw order to see how it was picked, or choose Smallest first to sort it numerically. Regenerate numbers makes a fresh draw.
Sources & calculation notes
Specifies how a browser provides random values to an integer typed array.
Explains the browser randomness source, supported typed arrays and API limits.
Method and input rules checked: . Engineering validation; no professional specialist review is claimed.