Random number generator

Up to 1000 numbers at once, any range, an option without repeats and sorting. The same cryptographic randomness as the password tools.

Where it helps

What random numbers are for

Giveaways and contests. Participants are numbered — comments under a post, rows in a spreadsheet, ticket numbers. Set the range and get a winner. If the result has to be shown to outsiders, there is a draw by numbers with a permanent link.

Draws and running order. Who presents first, who gets which task variant, in what order the talks go. The no-repeats mode returns a permutation rather than a set with duplicates.

Lottery combinations. The ready-made buttons for 4 of 20, 5 of 36, 6 of 45 and 7 of 49 are the same numbers without repeats, sorted ascending.

Testing and teaching. A sample of rows from a table for manual review, random examples for a problem set, a coin flip and a dice roll without a coin or dice.

About randomness

Why not Math.random()

The built-in Math.random() is tuned for speed, not for unpredictability: its state can be reconstructed from a handful of outputs. For a draw with a prize at stake that is enough to make the result unfair.

We take numbers from crypto.getRandomValues and map them onto the range by rejection: if a value lands in the tail that does not divide evenly, it is discarded and the next one is drawn. Without that step the lower numbers would come up more often.

Common cases

Questions

Frequently asked questions

How random are these numbers?

The source is the operating system cryptographic generator through crypto.getRandomValues, and the range mapping uses rejection sampling, so every number is equally likely. Plain Math.random() is not good enough for a prize draw.

Can I use it for a prize draw?

Yes, but nothing is stored — the page writes nothing to a server. For contests that need proof, record the screen or use a service that gives a permanent link to the result.

Next

Other tools

Copied