Random number generator

Pick a range, say how many you want, and choose whether repeats are allowed. Uses your browser's cryptographic random source, not Math.random().

Options
7

Why this uses crypto randomness

Most generators on the web call JavaScript's Math.random(). That is a pseudo-random function: fast, fine for shuffling a slideshow, and explicitly not suitable for anything where the result matters. Its output is deterministic given the internal state, and browsers make no guarantees about its quality.

This page uses crypto.getRandomValues() instead, which browsers back with the operating system's cryptographic random source. It is the same facility used to generate encryption keys.

It also avoids modulo bias. Taking a random 32-bit number and using the remainder after division by your range makes low numbers very slightly more likely, because the range rarely divides evenly into 2³². The fix — rejecting values that fall in the uneven tail and drawing again — is what this does. The effect is small, but "small and avoidable" is not a good reason to leave a bias in a tool people use for prize draws.

Good enough for a raffle, not for gambling regulation. A published draw that has to be auditable needs a documented, verifiable procedure — a certified RNG, or a public source of randomness with a published seed. A web page cannot prove to a third party what it generated.

Duplicates, and why the limit exists

With duplicates allowed, every draw is independent — asking for six numbers from 1 to 10 can genuinely return three 7s. That is what randomness looks like, and it is usually not what people want from a raffle.

No duplicates draws without replacement instead, like pulling tickets from a hat. You cannot ask for more numbers than the range contains: eleven unique numbers from 1 to 10 is impossible, and the tool will say so rather than loop forever or quietly return ten.

What it is good for

Common questions

Are the numbers really random?

They come from your operating system's cryptographic random source, which is the best available to a web page. No sequence produced by software is random in the philosophical sense, but this is indistinguishable from random for every practical purpose short of regulated gambling.

Can two people get the same numbers?

Only by coincidence. There is no shared seed and no server involved — each visitor's browser draws independently.

Does it include the "from" and "to" numbers?

Yes. Both ends are included, so 1 to 10 can return 1 or 10. This catches people out because many programming functions exclude the upper bound.

Is my draw recorded?

No. Nothing is sent anywhere and nothing is stored. Reloading the page loses the result, so copy anything you need to keep.

Other tools

Username generator Twelve at a time, in five styles Word counter Words, characters, sentences and reading time BMI calculator Metric, stones and pounds, with NICE thresholds