Math / utility
Random Number Generator
Generate bounded secure random integers in an inclusive range, with repeated or unique values and validated quantity limits.
Calculator
Calculator
Generate secure random integers.
Integers only, between −1 billion and 1 billion. Generate 1–1,000 values with optional uniqueness. Uses crypto.getRandomValues locally; not for passwords or gambling.
Your result
Enter details to see the result.
Complete the inputs and calculate to see the main result and its supporting breakdown.
Example
Worked example
Example inputs
- Minimum integer
- 1
- Maximum integer
- 100
- Quantity
- 5
- Duplicates
- Allow repeated values
Calculation breakdown
Unbiased rejection sampling maps secure 32-bit random values to range indices; sparse Fisher–Yates sampling gives unique values without retries for collisions.
Example result
Random integers
18, 15, 38, 50, 99
How to interpret the result
Repeated mode may show duplicates, while unique mode cannot. Reset clears the generated result; the values are random draws and do not predict any future event.
How to use this calculator
- Set inclusive minimum and maximum whole-number endpoints.
- Choose how many values to generate and whether duplicates are allowed.
- Generate a fresh local sample; unique quantity cannot exceed the range size.
How it works
Formula
Unbiased rejection sampling maps secure 32-bit random values to range indices; sparse Fisher–Yates sampling gives unique values without retries for collisions.
Can I generate every value in a small range?
Yes, with unique mode and quantity equal to the inclusive range size. Values are sampled without replacement.
What this calculator does
Draw integers from an inclusive range and choose whether repeated values are allowed in your output.
Inputs you will need
Required or selected inputs
- Minimum integer
- Maximum integer
- Quantity
- Duplicates
Assumptions
- Endpoints are whole numbers and inclusive. Randomness comes from platform cryptographic randomness and is generated on calculation.
Limitations
- Range endpoints are ±1 billion and quantity is 1–1,000. A browser without secure randomness returns an error; this is not a key or gambling tool.
Useful next steps
Compare theoretical event probabilities separately from a random draw with Probability Calculator.
See how HandyChest handles units, validation, rounding, and testing, or Report a problem with this calculator.
Good to know
Frequently asked questions
How should I read the random number generator result?
Repeated mode may show duplicates, while unique mode cannot. Reset clears the generated result; the values are random draws and do not predict any future event.
Keep going