Random Number Generator — Pick From a Range
A crypto-grade random number generator with ranges, unique mode and decimals
Runs in your browser · nothing is uploaded
What it is
Set a minimum, a maximum and how many numbers you need, and this tool draws them for you. It works for raffles, seating orders, test data, board-game house rules, or any time you want a number nobody chose. Negative ranges are fine, and you can switch to decimals with a fixed number of places. Everything runs inside your browser tab; your settings and results are never sent to a server.
How to use
- Choose Integers or Decimals.
- Enter the minimum and maximum. Both ends can be drawn.
- Enter how many numbers you want, from 1 to 10,000.
- Turn on No repeats if every number must be different. For decimals, also pick the number of places.
- Press Generate. Change the sort order and separator while looking at the result, then use Copy to take it with you.
How it works
- Randomness source: only 32-bit values from
crypto.getRandomValues.Math.randomis never used. - Uniformity: taking a raw 32-bit value modulo the range size slightly favours small numbers. The tool throws away values from the uneven tail and redraws (rejection sampling), so each number has the same chance.
- Huge ranges: when the span exceeds 2^32 the draw switches to BigInt arithmetic, so even the full range of plus or minus 9,007,199,254,740,991 stays unbiased.
- No repeats: Floyd’s sampling algorithm picks exactly the number of values you ask for without listing the whole range. Every possible set is equally likely, and the order is shuffled unless you pick a sort.
- Decimals: the tool chooses uniformly among all multiples of 10^-places inside your bounds (0.01 steps for two places) and prints them as exact text, so there is no floating-point noise.
- Display options: sort order and separator (comma, space, new line) reformat the drawn numbers without drawing again.
Examples
| Settings | Possible result |
|---|---|
| 1–45, 6 numbers, no repeats, ascending | 3, 11, 19, 27, 38, 44 |
| -10–10, 5 numbers | 7, -3, -3, 0, 10 (negatives and repeats allowed) |
| 0–1, 2 decimal places, 3 numbers | 0.27, 0.84, 0.05 |
| 1–100, 1 number | any single value from 1 to 100 |
FAQ
Are the numbers really random, and how is this different from Math.random?
The tool uses only the cryptographic generator built into your browser (crypto.getRandomValues) and never Math.random. It also removes modulo bias by discarding the few raw values that would favour small numbers and drawing again (rejection sampling), so every number in your range is exactly equally likely.
What happens in no-repeat mode if I ask for more numbers than the range holds?
You cannot draw 6 different numbers from 1 to 5, so the tool shows an error and draws nothing. Widen the range or lower the count. Even for enormous ranges only the requested amount of work is done, so it stays fast.
How large can the numbers be?
Integer mode accepts any safe integer from -9,007,199,254,740,991 to 9,007,199,254,740,991, the limit of exact whole numbers in JavaScript. You can draw from 1 to 10,000 numbers at a time.
Does changing the sort order or separator draw new numbers?
No. Sorting and the separator only change how the numbers you already drew are displayed. Press Generate when you want fresh ones.