Random number generator
Pick random numbers between any minimum and maximum, as whole numbers or decimals, with optional no-repeat and sorting. It uses your browser's secure random generator, with no bias, and nothing leaves your device.
How to use it
- Enter the Minimum and Maximum (both are included).
- Set How many numbers, and choose whole numbers or decimals in Type.
- Tick No repeats for a draw without replacement, and pick an Order if you want them sorted.
- Click Run and copy the result.
How to generate random numbers fairly
What a random number generator is for
People reach for random numbers more often than they expect: picking a raffle winner, choosing which students answer first, sampling rows from a spreadsheet, creating test data, running a board game or a classroom probability exercise. Doing it by hand tends to be biased, because humans avoid repeats and like numbers such as 7. This tool draws the numbers for you between a minimum and a maximum you choose, as whole numbers or decimals, and can list them sorted or without repeats.
How the numbers are drawn
The generator does not use Math.random. It asks the browser's cryptographic source, crypto.getRandomValues, for 32-bit random values. A plain remainder operation on those values would slightly favor the low numbers of a range, so the tool uses rejection sampling: any raw value that falls in the uneven leftover zone at the top is thrown away and a new one is drawn. Every number in the range then has exactly the same chance. Both the Minimum and the Maximum can appear.
For decimals, the range is converted to whole steps. With two decimal places, 0 to 1 becomes the 101 values 0.00, 0.01, ..., 1.00, one of which is drawn and shown again with two decimals. A minimum or maximum with more decimals than you asked for is trimmed inward, so every result stays inside your range.
With No repeats ticked, the draw is without replacement, like pulling tickets from a hat. For ranges up to 200,000 values the tool builds the list of all values and does a partial shuffle, which is unbiased. For very large ranges it simply redraws whenever it hits a number that was already picked. You cannot ask for more different numbers than the range holds, and the tool says how many exist.
Fields and limits
| Field | What it does |
|---|---|
| Minimum / Maximum | Both ends are included. The minimum cannot be above the maximum. |
| How many numbers | A whole number from 1 to 1000. |
| Type | Whole numbers or Decimals. |
| Decimal places (for decimals) | 1 to 8, used only when the type is decimals. |
| No repeats | Each value appears at most once. |
| Order | As generated, Ascending or Descending. |
Below the list you also get a summary with the count, the smallest and largest values, the sum and the average.
Worked example
To check that the options do what they say, set Minimum to 1, Maximum to 10, How many numbers to 10, tick No repeats and choose Ascending in Order. Because ten different numbers must be taken from only ten possible values, the result is always 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, with a summary of Count 10, Smallest 1, Largest 10, Sum 55 and Average 5.5.
Now ask for 6 numbers with No repeats in the range 1 to 5. The tool refuses and reports that only 5 different values exist. Finally, set Type to Decimals with 2 decimal places and the range 0 to 0.02, 3 numbers, no repeats and ascending: the only possible answer is 0.00, 0.01, 0.02. With a wider range, such as 0 to 1, each run gives different numbers, so any sample here would be just one of many outcomes.
Tips and common mistakes
- Randomness has no memory. Seeing the same number twice in a row does not mean the tool is broken; ticking No repeats is how you prevent it.
- To draw winners from a list of 250 entries, number the entries 1 to 250, set that range, and draw with No repeats. Keep a record of the result if others will check it.
- The numbers are generated in your browser and are not stored, so copy them before closing the page.
- If a raffle, lottery or contest is regulated, follow the official rules for how the draw must be done and witnessed; a web tool alone may not meet them.
Related tools
To pick a name rather than a number, use the random name picker. For game dice, see the dice roller, and for unique identifiers use the UUID generator.
Questions
Are the numbers really random?
They come from crypto.getRandomValues, the secure random source built into your browser, which is much stronger than Math.random for draws and giveaways.
Is there any bias toward some numbers?
No. Values are picked with rejection sampling, which throws away the few raw values that would make some results slightly more likely than others.
Are the minimum and maximum included?
Yes, both ends can appear. With decimals, the range is split in steps of the decimal places you choose.
What does "No repeats" do?
Each number can appear only once, like drawing tickets from a hat. You cannot ask for more numbers than the range contains.