webutilkit

Random Number Generator

Generate random whole numbers in a range you choose, using a secure random source in your browser.

Result

How it works

Each number comes from crypto.getRandomValues, the browser’s cryptographically secure random number generator, mapped into your chosen range. Both endpoints are included, and minimum and maximum can be given in either order.

Why not Math.random?

Math.random() is fine for animations or shuffling a game board, but its output can be predictable enough in some browser engines to reconstruct past or future values. crypto.getRandomValues is the same primitive used for generating encryption keys — suitable for anything where unpredictability actually matters, like a drawing or a raffle.

Independent draws

Each number in a batch is generated independently, so repeats are possible by design — the same way a real die can land on the same face twice in a row.

Frequently asked questions

Is this suitable for a raffle or drawing?

Yes. Numbers come from crypto.getRandomValues, a cryptographically secure random source, rather than Math.random.

Can the same number appear twice when generating several at once?

Yes, each number is drawn independently, so repeats are possible — the same way rolling two dice can land on the same number twice.