Random Number Generator
Draw whole numbers or decimal-grid values within your chosen bounds. Set the quantity, allow or prevent duplicates, and optionally sort the output; sorting changes presentation, not which values were drawn.
Generate random numbers
How random picks work
- Each number in the range has the same chance on every pick.
- With repeats allowed, the same number can come up again; choose unique numbers to prevent that.
- Repeats happen sooner than people expect: 12 picks from 1–100 already have about a 50% chance of a repeat.
- For passwords or security keys, use a password generator, not a number picker.
How to use the Random Number Generator
- Enter the minimum value allowed in the range.
- Enter the maximum value allowed in the range.
- The generator selects a value within those boundaries.
- When integers are requested, results are restricted to whole numbers rather than arbitrary decimal values.
- Repeated draws can produce the same number unless uniqueness is specifically required and supported.
- For security-sensitive applications, use a system specifically designed and reviewed for cryptographic randomness.
How the numbers are drawn
The generator uses browser crypto.getRandomValues when available, with rejection sampling for the discrete grid. It falls back to Math.random when that API is unavailable. Decimal mode selects grid values directly rather than rounding a continuous draw. With duplicates disabled, each selected value is removed from the remaining choices.
Repeats are normal in random data. Drawing 10 numbers from 1–100 gives at least one repeat about 37% of the time. When each number may be used only once, such as for raffle winners, turn off duplicates; the generator then refuses requests for more unique numbers than the range contains.
Finite precision defines the draw space
Integer bounds round inward. Decimal mode selects only multiples of the chosen precision inside the range. Unsupported safe-integer grid sizes are rejected. Browser cryptographic randomness is used when available, with Math.random as fallback; this utility is not a certified lottery or security system.
Examples
Classroom selection
A teacher can generate an integer from 1 to 30 when selecting a numbered student or exercise.
Software testing
Developers can generate varied input values inside an expected range to exercise different application paths.
Repeated values are possible
If you draw from 1 to 10 several times, the same value may legitimately appear more than once unless sampling without replacement is used.
Simulating a die
Set the range to 1–6 and generate one number per roll. Over many rolls each face should appear about 1/6 of the time, though short runs often look uneven.
Raffle with 250 tickets
Generate 3 numbers from 1–250 with duplicates off. Each winning ticket is different, and every ticket has the same chance of being drawn.
Check the result in context
A finite grid: minimum 0.11 and maximum 0.29 at one decimal place permits only 0.2. Requesting two unique values is impossible; duplicate-enabled draws may repeat 0.2.
Chance of at least one repeat when picking from 1–100
| Numbers picked | Chance of a repeat |
|---|---|
| 2 | 1.0% |
| 5 | 9.7% |
| 10 | 37.2% |
| 12 | 49.7% |
| 15 | 66.9% |
| 20 | 87.0% |
| 30 | 99.2% |
Chance a particular number appears at least once
1 − (1 − 1/N)ᵏ for k draws from a range of N values, with repeats allowed.
| Range | 5 draws | 10 draws | 50 draws |
|---|---|---|---|
| 1–6 | 59.8% | 83.8% | >99.9% |
| 1–10 | 41.0% | 65.1% | 99.5% |
| 1–100 | 4.9% | 9.6% | 39.5% |
Frequently asked questions
Can the same number appear twice?
Yes. Independent random draws can repeat values unless the generator specifically provides a unique-number mode.
Is this suitable for passwords or encryption keys?
Do not assume a general-purpose random-number tool is appropriate for security-sensitive cryptographic use.
Is every number guaranteed to appear equally often in a small sample?
No. Randomness does not mean perfectly even short-term distribution. Noticeable clustering can occur by chance.
What is the difference between random and unique?
Random describes how values are selected. Unique means a value cannot repeat within a particular set of results.
Is every number equally likely?
Yes. Each value in the range has the same probability on every draw. Small samples can still look uneven, which is expected.
How do I pick several winners without repeats?
Set the quantity to the number of winners and turn off duplicates. The generator will only return distinct numbers.
Why is my decimal range rejected even though minimum is below maximum?
There may be no value on the selected grid. Between 0.11 and 0.19 there is no one-decimal value. Choose two decimal places or widen the range.
More math tools
Password Generator
Generate strong, random passwords securely in your browser.
Open tool →UUID Generator
Generate one or multiple random UUID version 4 identifiers.
Open tool →Permutation Calculator
Calculate nPr permutations with or without repetition.
Open tool →Combination Calculator
Calculate nCr combinations with or without repetition.
Open tool →Probability Calculator
Calculate simple and independent-event probabilities.
Open tool →Volume Calculator
Calculate volume for cubes, rectangular prisms, cylinders, cones, spheres, pyramids and triangular prisms.
Open tool →