Random numbers quietly run a surprising amount of everyday life: the order of songs in a shuffled playlist, the ticket drawn at a raffle, the sample of customers chosen for a survey, the student picked to answer first. Whenever the choice must be fair — and be seen to be fair — flipping a mental coin is not enough. This random number generator draws numbers from your browser’s cryptographically secure random source, the same system your device uses to create encryption keys, so the results are unbiased and impossible to predict or steer.
You control the shape of the draw. Set any minimum and maximum, ask for up to a thousand numbers at once, and decide whether repeats are allowed. With duplicates on, every draw is independent, exactly like rolling a die a hundred times: the same value can and will come up again. With duplicates off, the generator works like a lottery machine, removing each number as it is drawn so your set contains only unique values — the right choice for assigning places, picking distinct winners, or shuffling a list of entries. A decimals mode covers the cases where whole numbers are too coarse, such as generating test data, random coordinates or sample measurements.
How fair random generation works
Computers are built to be predictable, so producing genuinely unpredictable numbers takes care. This tool asks the operating system, through the browser’s Web Crypto API, for random bytes drawn from system entropy — timings, hardware noise and other unpredictable inputs. It then maps those bytes onto your range using rejection sampling: values that fall in the incomplete final block are discarded instead of wrapped around. That detail matters, because the naive shortcut (taking a remainder) makes small numbers slightly more likely than large ones. With rejection sampling, every number in your range has exactly the same probability, which is what “fair” means in practice.
Worked example: picking 5 raffle winners from 500 tickets
Suppose 500 raffle tickets were sold and you need five distinct winning numbers. Set the minimum to 1, the maximum to 500, the count to 5, and switch duplicates off. One click might produce 37, 412, 88, 260 and 194 (your draw will differ — that is rather the point). Because duplicates are off, no ticket can win twice; because the source is cryptographically secure, nobody could have predicted the set in advance. If instead you were rolling for a board game, you would set the range to 1–6 with duplicates on, and getting 4, 4, 2 would be a perfectly normal result.
Choosing the right settings
| Job | Range | Count | Duplicates |
|---|---|---|---|
| Raffle / giveaway winners | 1 to number of entries | Prizes available | Off |
| Dice substitute | 1 to 6 (or 1 to 20) | Rolls needed | On |
| Lottery-style picks | 1 to 49 | 6 | Off |
| Random test data | Any, e.g. 0 to 1 | Up to 1,000 | On, decimals on |
| Classroom cold-calling | 1 to class size | 1 | Off (track drawn numbers) |
Random is clumpier than you expect
One warning from experience: real randomness does not look tidy. In a hundred coin flips, a run of six heads in a row is not suspicious — it is expected, happening in most long sequences somewhere. People who distrust a draw because "the same number came up twice" are usually seeing fairness, not a bug: with duplicates allowed, repeats are part of an honest distribution, and a generator that quietly avoided them would be rigged, not improved. If your use genuinely requires no repeats, that is what the duplicates toggle is for — an explicit rule, openly applied, rather than hidden fiddling with the odds.
For playful randomness with dice of many shapes, try our dice roller, which keeps a roll history and totals. For secret codes rather than public draws, use the password generator — random numbers alone do not make a safe password. And when the "random" choice is really a scheduling question, the date calculator handles the calendar side of things.
Frequently asked questions
How does this random number generator work?
It uses your browser's cryptographically secure random source (the Web Crypto API) to draw numbers uniformly from the range you set, rejecting values that would bias the result, so every number in the range has an equal chance.
Are the numbers truly random?
They come from a cryptographically secure pseudorandom generator seeded with entropy from your operating system. That is the same class of randomness used for security tokens, and it is unpredictable in practice — far stronger than the simple Math.random used by many tools.
What does "allow duplicates" mean?
With duplicates allowed, each draw is independent, so the same number can appear more than once — like rolling dice. With duplicates off, every number in your set is unique, like drawing lottery balls without putting them back.
Can I generate decimal numbers?
Yes. Switch on decimals and choose how many decimal places you need, from 1 to 10. The generator then produces values anywhere between your minimum and maximum, rounded to that precision.
How many numbers can I generate at once?
Up to 1,000 at a time. If duplicates are off, the count cannot be larger than the number of whole values in your range — for example, a range of 1 to 10 holds only 10 unique integers.
Can I use these numbers for a raffle or giveaway?
Yes. The draws are uniform and unbiased, which is what a fair raffle needs. For a public giveaway, generate the winning numbers in front of witnesses or on a screen share, and keep a note of the settings you used.
Should I use this to create a password?
No — use our password generator instead. Passwords need letters and symbols as well as digits, and a dedicated generator builds them with the right mix and strength checks.
What is the difference between random and pseudorandom?
Truly random numbers come from physical events like electronic noise. Pseudorandom numbers come from an algorithm, but a cryptographically secure one seeded with real-world entropy is unpredictable in practice, which is what matters for fairness and security.
Is this random number generator free and private?
Yes. It is free with no sign-up, and generation happens entirely in your browser — your ranges and results are never sent to a server.