Random Number Generator
Generate one or many random numbers in any range, with or without repeats, sorted or unsorted, using your browser's cryptographically secure randomness. Free online random number generator.
Result
—
Need to pick names from a list, roll dice or flip a coin? Use the Random Picker
Numbers are generated in your browser with crypto.getRandomValues. Nothing is sent to a server; your settings and last result are saved only on this device.
Usage examples
Draw a raffle winner
Set the range to 1 and the highest ticket number, for example 1–250, and generate one number. Announce it straight away; if that ticket is unclaimed, generate again.
Lottery-style number sets
The 6 × 1–45 and 6 × 1–49 presets draw six different numbers and sort them ascending, just like a lottery slip. Every set is equally likely, so no pick is luckier than another.
Pick a random sample for an audit or survey
To check 30 of 1,200 spreadsheet rows, enter 1–1200, ask for 30 numbers with no repeats, sort ascending and use the new-line separator. Copy the list and paste it into a spreadsheet column to filter those rows.
Put a class or team in random order
With 25 students, generate 25 numbers from 1–25 with no repeats and leave the order as drawn. The result is a random permutation: the first number presents first, the second presents next, and so on.
Create test data with decimals
For dummy prices, set 0.99 to 99.99, two decimal places and 20 numbers, then copy them comma-separated into your test fixture or SQL insert.
Quick reference
Odds of drawing k different numbers from 1–N (order doesn't matter)
| Draw | Possible combinations | Chance of matching all |
|---|---|---|
| 1 from 1–10 | 10 | 1 in 10 |
| 1 from 1–100 | 100 | 1 in 100 |
| 3 from 1–10 | 120 | 1 in 120 |
| 5 from 1–50 | 2,118,760 | 1 in 2,118,760 |
| 6 from 1–45 | 8,145,060 | 1 in 8,145,060 |
| 6 from 1–49 | 13,983,816 | 1 in 13,983,816 |
| 5 from 1–69 | 11,238,513 | 1 in 11,238,513 |
| 7 from 1–35 | 6,724,520 | 1 in 6,724,520 |
Frequently asked questions
How random are these numbers?
They come from crypto.getRandomValues, the cryptographically secure random number generator built into your browser and seeded by your operating system's entropy pool. Its output is designed to be unpredictable even to someone who has seen earlier values, which is a stronger guarantee than Math.random gives. Like every software generator it is pseudo-random rather than a physical measurement, but no statistical test or observer can tell it apart from true randomness.
What is modulo bias and how does this tool avoid it?
The browser hands out 32-bit values from 0 to 4,294,967,295. Taking that value modulo 6 to roll a die would make 0–3 appear 715,827,883 times each but 4 and 5 only 715,827,882 times, because 4,294,967,296 is not a multiple of 6. For large ranges the skew is huge: with a range of 3,000,000,000, the lowest 1.29 billion values would be twice as likely as the rest. This tool uses rejection sampling instead: any raw value at or above the largest multiple of the range size is thrown away and a new one is drawn, so every result has exactly the same probability.
How does the no-repeats option work?
When it is on, each value can appear at most once, like drawing balls from a drum without putting them back. You can't ask for more numbers than the range contains (for example 11 numbers from 1–10); the tool tells you how many values are available. Asking for every value in the range, such as 25 numbers from 1–25, gives a random shuffle of the whole range.
How do decimal places work?
With 2 decimal places and a range of 1 to 2, the tool picks uniformly among 1.00, 1.01, 1.02 … 2.00, all 101 of them, with both ends included. The minimum and maximum are rounded to the chosen number of decimals first, so 0.555 becomes 0.56 at two decimals.
Can this tool help me win the lottery?
No. Every combination of a fair draw is equally likely, whether it is 1-2-3-4-5-6 or a set generated here. The table on this page shows the odds: matching all six numbers in a 6-from-49 draw is 1 in 13,983,816. A random pick only saves you from choosing birthdays and other common patterns that many people share, which can matter for how a jackpot is split.
What is the difference between this and the Random Picker?
This tool is for numbers: ranges, negative values, decimals, thousands of results and sorted output. The Random Picker draws names or items from a list you type, rolls dice and flips coins. Both use the same crypto.getRandomValues source with unbiased sampling.
Are my numbers saved or sent anywhere?
Everything runs in your browser. Your range, options and the last result (up to 1,000 numbers) are kept in this browser's local storage so they are still there when you come back; nothing is uploaded. You can generate up to 10,000 numbers at once, from ranges with up to about 9 quadrillion (2^53) possible values.