Random Number Generator
How it works
Each number is drawn from a 32-bit random value via crypto.getRandomValues, but a raw value is not simply reduced with a modulo — the space of 32-bit values is (almost always) not an exact multiple of your range, so the numbers just past the last full multiple would otherwise come up very slightly more often. Those are rejected and redrawn instead, so every draw that survives is uniform across the range with no leftover bias.
With duplicates off, the numbers are drawn the way raffle tickets come out of a barrel: each draw removes that value from what is left to draw next, so the same number cannot appear twice and the batch is impossible to produce if the count asked for is larger than the range itself holds.
Frequently asked questions
How random are these numbers, really?
They come from crypto.getRandomValues, the same cryptographically secure source the browser gives JavaScript for things like generating encryption keys — not Math.random(), which is fast but not specified to be unpredictable. This tool also rejects and redraws any raw value that would land unevenly across your chosen range, so every number in range is exactly as likely as every other one. That matters if you are using this for anything where a real bias would be a problem — a raffle, a lottery-style pick, or a randomized draw of any kind.
What does "allow duplicates" change?
On, each number is drawn independently, so the same number can come up more than once in one batch — like rolling a die repeatedly. Off, every number in the batch is guaranteed distinct, drawn the way names come out of a hat: once a value is drawn it is removed from what can be drawn next. Off requires your range to hold at least as many values as the count you asked for, or there are not enough distinct numbers to give out.
Why don't the numbers change when I adjust the settings?
Because a batch of random numbers, once produced, is meant to hold still — regenerating it the instant you nudge a field would silently swap out the numbers while you were still mid-adjustment or about to copy them, with no way to tell the swap had happened. So only the settings themselves (the range, the count, the duplicate toggle) update live; the numbers only change when you press Generate, and the tool tells you if your current settings no longer match what is on screen.