Random Number Generator
Generate random numbers between any minimum and maximum. No-repeats, seeded, decimal and dice modes — fair draws for games, giveaways and decisions, free.
About this tool
Need a fair way to pick a winner, roll virtual dice, or choose a number out of thin air? A random number generator gives you unbiased integers between any minimum and maximum you set. It is perfect for giveaways, classroom activities, games and everyday decisions.
Unlike simple scripts that use predictable math, this tool draws from your browser's cryptographic random source and uses rejection sampling, so every number in the range has exactly the same chance, with no hidden patterns. You can also ask for unique numbers only, sort the results, copy them, generate decimals, or use a seed to reproduce a draw. Everything happens on your device, instantly and free.
By Azhar Hussain · Last updated: 7 November 2026
How to use
Pick a preset — dice (1 to 6), coin flip (0 or 1), lottery (6 unique numbers from 1 to 49), standard (1 to 100) or D20 — or set your own minimum, maximum and how many numbers you want, up to 1,000 at a time. Choose whole numbers or decimals, allow repeats or switch on "No repeats" for unique numbers only, and pick the sort order. Click Generate Numbers and your list appears immediately, with a statistics line for multi-number draws.
For a raffle, set minimum 1 and maximum to your number of tickets. For dice, use 1 to 6 or switch to Dice mode, which rolls 2- to 100-sided dice and shows the total and average. Each click produces a fresh, independent set of numbers, so keep clicking until you have what you need. Use the Copy list, Copy CSV or Copy JSON buttons to take the results with you.
For a draw anyone can check afterwards, switch the random source to Seeded, type a seed word, and publish the seed and the settings before you generate. The same seed and settings always give the same draw — that is the honest way to run a public giveaway.
The math behind it
This tool does not claim "true randomness" — that would need a physical entropy source, like atmospheric noise. What it uses is your browser's cryptographic random source, crypto.getRandomValues: a cryptographically strong pseudorandom generator seeded from the operating system's entropy, so the results are for all practical purposes unpredictable. It is the same quality of randomness used to generate security keys, and far better than the basic Math.random function found in casual scripts, which is fine for games but technically predictable.
Each draw starts from a random fraction between 0 and 1. The formula is: result = Math.floor(random × (max − min + 1)) + min. The naive way to turn a random 32-bit value into a number in your range is to take the remainder after dividing by the range size — but that remainder is slightly biased whenever the range size does not divide 2³² evenly, because some values get one extra chance. This tool uses rejection sampling instead: any random value that would make the results uneven is thrown away and drawn again, so every integer between minimum and maximum — both ends included — is exactly equally likely. The largest range handled exactly is 4,294,967,296 values (2³²), for example 0 to 4,294,967,295; beyond that the arithmetic itself cannot stay exact.
The formula, with a worked example
Every draw starts from a random fraction between 0 and 1. The formula is result = Math.floor(random × (max − min + 1)) + min, where max − min + 1 is the number of possible values — so the range 1–100 has 100 possible values, and 1–6 has 6, exactly like a die.
Worked example: generate one number from 1 to 100. The range size is 100. Suppose the random fraction is 0.4128: Math.floor(0.4128 × 100) + 1 = Math.floor(41.28) + 1 = 41 + 1 = 42.
Dice example: roll two 6-sided dice. The first random fraction is 0.62: Math.floor(0.62 × 6) + 1 = Math.floor(3.72) + 1 = 3 + 1 = 4. The second is 0.95: Math.floor(0.95 × 6) + 1 = Math.floor(5.7) + 1 = 5 + 1 = 6. Total 4 + 6 = 10, average 10 ÷ 2 = 5.00.
Three dice: rolls 4, 6 and 2 give a total of 12 and an average of 12 ÷ 3 = 4.00.
In this tool the random fraction comes from crypto.getRandomValues with rejection sampling (see "The math behind it" above), so the worked example is not just an approximation — each value really does have the same chance.
What chance does each number have?
Because every value in the range is equally likely, each value's chance is simply 1 ÷ the number of possible values. A range of 1–10 gives each number a 1 in 10 chance (10%); a range of 1–100 gives each number a 1 in 100 chance (1%).
| Range | Possible values | Chance for each value |
|---|---|---|
| 1–6 | 6 | 16.67% |
| 1–10 | 10 | 10% |
| 1–20 | 20 | 5% |
| 1–49 | 49 | 2.04% |
| 1–100 | 100 | 1% |
| 1–1000 | 1000 | 0.1% |
That also means a small sample can look lopsided: ten draws from 1–100 will usually not cover the range evenly, and a mean far from the middle of the range is normal for a handful of draws. That is not a fault in the generator — it is what randomness looks like. With hundreds of draws the counts even out.
Settings for common uses
Start from one of these, then adjust. "Allow repeats: Off" means repeats are switched off, so every number in the draw is unique — use it whenever you are picking winners, not just one number.
| Use case | Min | Max | Count | Allow repeats | Type |
|---|---|---|---|---|---|
| Raffle — one winner from 200 entries | 1 | 200 | 1 | Off | Whole number |
| Pick 3 winners from 500 entries | 1 | 500 | 3 | Off | Whole number |
| Pick a random student from 30 | 1 | 30 | 1 | Off | Whole number |
| Simulate a 6-sided die | 1 | 6 | 1 | On | Whole number |
| Roll a D20 | 1 | 20 | 1 | On | Whole number |
| Pick a random month | 1 | 12 | 1 | Off | Whole number |
| Random decimal between 0 and 1 | 0 | 1 | 1 | On | Decimal |
| Generate 10 test values | 1 | 1000 | 10 | On | Whole number |
For a lottery-style set, pair "No repeats" with ascending sort: 6 unique numbers from 1 to 49, smallest first, reads like a lottery ticket. For test data, 10 values from 1 to 1,000 with repeats allowed is a quick sample.
Running a fair giveaway, step by step
- Number the entries — give every entrant a number from 1 to the total number of entries, in a list everyone can see.
- Screenshot the list before the draw, so nobody can say entries were added or removed afterwards.
- Screenshot the settings — minimum, maximum, how many numbers, and whether repeats are allowed.
- Generate the winning number (or numbers, with repeats off for multiple prizes).
- Screenshot the result immediately, including the statistics line.
- Share the screenshots publicly so everyone can see the draw happened as described.
- Look up the winner in the numbered list and announce them.
For a draw anyone can verify later, use seeded mode instead: publish the seed and the settings before the draw, run it, and anyone can reproduce the exact result with the same seed. Cryptographic randomness gives a result nobody can predict; seeded randomness gives a result everyone can check.
Dice and coin flips on this page
Switch the mode to Dice roll to roll 1 to 50 dice with 2 to 100 sides each — d4, d6, d8, d10, d12, d20, d100 or any custom size in between — and see each die, the total and the average. Switch to Coin flip to flip 1 to 200 coins and see the heads/tails tally. Both modes use the same crypto.getRandomValues source with rejection sampling, so every face and every flip is exactly 50/50 or equally likely.
For deeper dice work — dice notation like 2d6+3, advantage and disadvantage on a d20, and D&D ability scores — use our dice roller, which is built for tabletop games.
Common mistakes
- Expecting no repeats by default. Repeats are normal: each number is drawn independently, just like rolling dice. Switch on "No repeats" when you need unique numbers.
- Assuming the range excludes the maximum. Both ends are included: 1 to 6 can return 1 and 6, exactly like a die.
- Treating a small sample as unfair. Ten draws from 1–100 will not look even. Small samples are noisy — that is not a fault in the generator.
- Using decimals for money. Decimal results are subject to floating-point representation (0.1 + 0.2 is not exactly 0.3 in a computer). Never use them for money or anything that needs exact decimal arithmetic.
Honest limitations
- Not for cryptographic keys or passwords. Use the password generator for those — this tool is for draws, games and decisions, not for secrets.
- Not a substitute for an audited or certified draw system for regulated lotteries or legally binding draws.
- Seeded mode is only as secret as its seed. Do not use it for anything an adversary could guess the seed for — publish the seed only when you want the draw to be reproducible.
- Small samples are noisy. A mean far from the middle of the range after a few draws is normal, not evidence of bias.
- History is session-only. Recent results keep the last 15 draws in the current tab and clear when you refresh the page.
How it works
Draws use crypto.getRandomValues, the cryptographic random source built into your browser, seeded from the operating system's entropy. Rejection sampling throws away any random value that would make some outcomes more likely than others, so every integer in the range has exactly the same chance. Seeded mode uses the xoshiro128** algorithm from your seed, so the same seed and settings always reproduce the same draw. Unique numbers use a partial Fisher–Yates shuffle, which picks each value once without ever looping forever. Both ends of the range are included, up to 1,000 numbers per click, with a largest range of 4,294,967,296 values.
Nothing you generate is sent anywhere: every draw happens in your browser, and the page works offline once it has loaded. The figures on this page are computed from the tool's own formulas — the worked examples, the probability table and the statistics line all come from the same arithmetic the tool runs.
Frequently asked questions
Are the numbers truly random?
Can numbers repeat in the results?
What is the largest range I can use?
Can I get the same numbers again later?
What happens if I ask for more unique numbers than the range holds?
Are the minimum and maximum included?
Should I use this for lottery numbers?
Can it produce negative numbers?
Can I generate decimal numbers?
Why is every number equally likely?
Can I use this for passwords or security keys?
Does the history save between visits?
Related tools
Dice Roller
Password Generator
UUID Generator
QR Code Generator
Barcode Generator
Privacy Policy Generator
💬 Comments
Have a question about this page, or an idea to make it better? Share it below — your feedback helps everyone who uses this site.