The 1–10000 range
Ten thousand is the scale of a proper raffle: four-digit stubs, a numbered roll, a draw that has to be seen to be believed.
Each number is worth 0.01 percent. A four-digit code drawn this way carries about 13.3 bits of entropy, which is plenty for a ticket and nowhere near enough for a password.
One tap gives one ticket number. Raise the count for up to ten winners in a single pass, sorted and with no duplicates.
- 1 to 10000, both included
- 10,000 whole numbers
- 0.01%, exactly 1 in 10,000
- 1 to 10 numbers per draw
- None inside a multi-number draw
- Every draw gets a link that replays it
What a 1–10000 draw is for
- Drawing the winning stub from a 10,000-ticket raffle
- Picking a four-digit ticket or queue number
- Sampling a record from a ten-thousand-row list
- Choosing a random ID for a test fixture
- Running a prize draw with several tiers of winners
How the randomness works
Every tap calls crypto.getRandomValues, the browser's cryptographic generator, and asks it for one unsigned 32-bit value. That lands somewhere between 0 and 4,294,967,295, and it then has to be folded down to the 10,000 numbers in this range.
Folding it down with a plain remainder is where most generators go wrong, an error known as modulo bias. 10,000 does not divide 4,294,967,296 evenly: 7,296 values are left over at the top, and wrapping them around would make the first 7,296 numbers in the range fractionally likelier than the rest. This tool throws away any raw value at or above the last exact multiple of 10,000 and draws a fresh one instead. That is rejection sampling. It fires about 1 in 588,674 draws, and it is the difference between 0.01% exactly and 0.01% approximately.
Ask for more than one number and the tool keeps drawing until it holds that many distinct values, then sorts them ascending. Nothing is seeded, nothing is sent anywhere, and each draw is independent of the one before it. The roll history under the tool lives in your browser's local storage, where the clear button empties it. The daily lucky numbers elsewhere on this site work the opposite way on purpose: they use a seeded generator so the same date always returns the same set. How random is random sets the two side by side.
Ten thousand numbers feels large enough that a repeat should be unthinkable, and it is not. Draw at random and there is a fifty-fifty chance of seeing some number twice within about 118 draws, the same square-root effect that makes shared birthdays common in a room of 23 people. For a raffle that means one thing in practice: draw your winners in a single multi-number pass, which rules duplicates out, rather than tapping ten times and hoping.
- crypto.getRandomValues, the browser's cryptographic generator
- One unsigned 32-bit value, sometimes more
- Rejection sampling onto 10,000 slots
- 7,296 of 4,294,967,296 raw values, redrawn
- No. These tools are never seeded
- Your browser. No server ever sees a draw
1–10000 — frequently asked
Sell or assign the tickets in a numbered sequence, then set the count to the number of prizes and draw once. Post the result link with the winning numbers. Anyone who follows the link sees the same draw.
No. Ten thousand possibilities is about 13 bits, which a computer exhausts instantly. It is fine as a ticket number or a one-time code with an attempt limit behind it, and useless as a standalone secret.
Far likelier than it feels. After 118 draws the chance that some number has appeared twice passes 50 percent, and after 250 it is above 95 percent. Collisions grow with the number of pairs, which grows with the square of the draws.