Random number generator
Pick a random number between two values, or a list of numbers with no repeats.
This free random number picker works in your browser. All inputs and calculations run locally on your device without server uploads; details on browser processing and storage are set out in the privacy policy.
How fair is it?
Numbers come from your browser’s cryptographically secure random generator (crypto.getRandomValues), the same source used to make encryption keys. The tool also avoids “modulo bias”, a subtle flaw that makes some numbers slightly more likely in simple generators. Every number in your range has exactly the same chance.
Uses
- Draw a raffle or giveaway winner: number the entries, then pick one.
- Choose a random sample from a list for a survey or audit.
- Settle a decision with a dice roll or coin toss.
- For a random order of names, use Shuffle in the line tools.
Worked example: Drawing 6 unique lottery/raffle winners from 1 to 250
Suppose you are running an office raffle with 250 numbered tickets (`1` to `250`) and need to draw 6 distinct winning ticket numbers with no duplicates:
- Settings: Minimum =
1, Maximum =250, How many =6, No repeats = ticked, Sort = In the order drawn (so the 1st number is Grand Prize, 2nd is Runner-Up, and so on). - How unbiased selection works: Instead of `Math.random()`, the browser requests 32-bit cryptographically strong random integers from `window.crypto.getRandomValues()` and applies rejection sampling (discarding values above the largest multiple of `250` that fits in `2³²`, `4,294,967,250`) so every ticket from `1` to `250` has an exact `1 / 250` (`0.4000%`) probability with zero modulo bias.
- Sample output:
184, 19, 241, 73, 112, 6.
Limits and what this tool cannot do
- Whole integers only: Minimum and Maximum must be whole integers; to generate random decimals between `0.00` and `1.00`, generate an integer between `0` and `10,000` and divide by `10,000`.
- 'No repeats' requires `Count ≤ (Max − Min + 1)`: You cannot draw 15 unique numbers from a range of `1` to `10` because there are only 10 possible integers in that interval.
- No seed replay (`srand`) for deterministic simulations: Because `crypto.getRandomValues()` pulls entropy from your operating system's hardware CSPRNG, results cannot be replayed from a fixed numeric seed.
Questions
Can I get negative numbers?
Yes. Set From to a negative number.
What does No repeats do?
Each number appears at most once, like drawing balls from a bag. You cannot ask for more numbers than the range holds.
Are the results recorded?
No. They are made in your browser and nowhere else.
Why is crypto.getRandomValues() better than standard Math.random()?
`Math.random()` uses a fast pseudo-random algorithm (xorshift128+) meant for animations and games, whose internal state can be predicted from a sequence of outputs. `crypto.getRandomValues()` uses the operating system's cryptographic entropy pool (CSPRNG).
What is 'modulo bias' and does this generator avoid it?
If you take a random 32-bit integer (`0` to `4,294,967,295`) and compute `% 250`, the first 46 numbers (`0..45`) occur slightly more often because `2^32` is not evenly divisible by 250. Rejection sampling discards the top 46 values of the `2^32` range and redraws, making the distribution mathematically uniform.
Are the minimum and maximum numbers both included in the draw?
Yes. The range is inclusive on both ends: setting Min = 1 and Max = 6 simulates a standard 6-sided die where both 1 and 6 can be rolled.