Generate numbers from your browser's cryptographic random source with no way to weaken it β this tool deliberately offers no seeded or fast mode. Values are mapped onto your range with rejection sampling, so no number is more likely than another.
Settings
Recent results
Generated locally in your browser β your settings and results never leave this page.
What the word secure is doing
Every random number generator produces output that looks scrambled. That is the easy part, and it is not what separates a secure generator from an ordinary one.
The distinction is predictability. A general-purpose generator keeps a small internal state and derives each value from the last by a fixed rule. Watch enough output and that state can often be reconstructed, at which point every future value is known. This is not a theoretical concern β it has been demonstrated against widely used generators repeatedly.
A cryptographically secure generator is built so that observing output does not help. Its state is large, it is seeded from genuine operating-system entropy, and the transformation from state to output is designed to be irreversible. The bar is not “looks random” but “cannot be predicted even by someone who has seen a great deal of the output”.
Where the difference bites
For an animation, a shuffle of a playlist or a decorative effect, an ordinary generator is fine and faster. The cases that matter are the ones where somebody has a reason to predict the next value: prize draws, tokens, anything where guessing correctly is worth money or access.
The uncomfortable part is that a weak generator produces output that looks exactly like a strong one. There is no visual inspection that distinguishes them, no test a user can run on the result. The only thing that separates them is the method, which is why this tool states its method on every result rather than leaving it implicit.
Rejection sampling and the bias nobody sees
Generating a number in a range sounds trivial. Take a random 32-bit value and reduce it modulo the size of the range. It works, and it is subtly wrong.
The generator produces values from zero to a fixed maximum. Unless the range divides that span evenly, the leftover values at the top wrap around and land on the lowest results, which therefore come up slightly more often. For a small range and a large generator span the effect is tiny. For a large range it becomes measurable, and in a draw with money attached, measurable is enough to matter.
Rejection sampling avoids it entirely: values in the leftover region are discarded and a fresh one is drawn. The cost is a negligible number of extra draws. The benefit is that every number in your range is exactly as likely as every other, which is the property people assume they are getting.
Unpredictable is not the same as unique
Independent draws repeat. Ask for ten numbers between 1 and 10 and you will usually get duplicates, and that is correct behaviour rather than a fault. People are often surprised by this, in the same way they are surprised that a small group frequently contains a shared birthday.
If you need distinct values, the no-repeats option samples without replacement instead, which is a different operation with different odds.
Unpredictable does not make a draw provable
A cryptographic draw cannot be reproduced β that is the point. It also means an organiser cannot demonstrate to entrants that a published winner was the one the tool actually produced. Where that proof matters, a published seed and an audit record are what provide it, which is what the verifiable draw tool is for.
Privacy
Numbers are generated in your browser and are never transmitted, stored, logged or written into the page link.
How to use the Secure Random Number Generator
- Set the range you need and how many numbers to draw.
- Turn on "no repeats" if every value must be distinct.
- Generate. Every value comes from your browser's cryptographic random source.
Frequently asked questions
What makes a random number generator "secure"?
Two properties. It is seeded from genuine operating-system entropy rather than something predictable like the clock, and its output is designed so that seeing past values tells an attacker nothing useful about future ones. Ordinary generators fail the second test completely.
How is this different from Math.random?
Math.random is built for speed, not secrecy. Its internal state can often be reconstructed from a handful of outputs, after which every future value is predictable. That is harmless for an animation and disqualifying for a prize draw. This tool uses crypto.getRandomValues, the same source a browser uses for its own cryptography.
Why does this tool have no seeded mode?
Because a page about unpredictability should not ship a control that quietly removes it. Someone who needs reproducible values has a dedicated tool for that; leaving the option here would mainly serve to let it be switched on by accident.
What is modulo bias and why does it matter?
It is the skew introduced by mapping random numbers onto a range using the remainder operator. Unless the range divides evenly into the generator's output space, the lowest values come up slightly more often. This tool uses rejection sampling instead β values that would cause the skew are discarded and redrawn β so every number in your range is equally likely.
Is this suitable for a prize draw?
The randomness is appropriate. What it cannot provide on its own is proof to other people that the draw was fair, because a cryptographic draw is unrepeatable by design. For a public giveaway, the verifiable draw tool gives entrants something they can check.
Can the numbers be predicted or influenced?
Not in any practical sense. The generator is seeded from operating-system entropy that a web page cannot see or affect, and it is designed so that observing output does not reveal the internal state. The realistic weaknesses in any such system are elsewhere β in how a result is handled after it is produced.
Does "secure" mean the numbers are unique?
No, and this is a common confusion. Secure means unpredictable, not distinct. Independent draws can repeat, exactly as two dice rolls can both come up four. Turn on "no repeats" when you need every value to differ.