LazyTools

🔒 Every tool runs in your browser, the files and values you enter are never uploaded to any server. How it works

🎲 Random Number Generator

True random numbers in any range, one or many, unique or repeating, from the browser’s cryptographic source, so draws are actually fair.

56

crypto.getRandomValues + rejection sampling, every value equally likely, drawn on your device.

Rate this tool:
Anonymous, no account, no identifier

How the random number generator works

Numbers come from crypto.getRandomValues with rejection sampling, which guarantees every value in your range is exactly equally likely (naive modulo arithmetic skews toward low numbers). "Unique" mode performs a draw-without-replacement, a partial Fisher, Yates shuffle, so no value repeats, which is what raffles and assignments need.

For picking contest winners, the fairness details matter: cryptographic source (unpredictable), rejection sampling (unbiased), without-replacement (no duplicate winners). That combination is what "we drew winners randomly" should mean, and it runs verifiably on your device.

Frequently asked questions

Are these truly random or pseudo-random?

Cryptographically secure pseudo-random: seeded from the operating system's entropy (hardware noise, timing), unpredictable in practice, the same class used for encryption keys. Distinct from Math.random(), which is reproducible and unsuitable for anything fair.

Is every number in the range equally likely?

Yes, rejection sampling discards raw values that would bias the mapping (the classic modulo-bias flaw in naive generators). 1 and the maximum have exactly equal probability.

How do I draw raffle winners without duplicates?

Set the range to your entry count, choose how many winners, and enable unique. Each entrant can win at most once; order of results is the draw order.

Can I generate negative numbers or decimals?

Negative ranges work (set min below zero). For decimals, generate integers at 10× or 100× scale and divide, which also makes the precision explicit.

Can anyone verify or influence the draw?

It runs locally with OS-grade randomness, nothing external influences it, and no server logs it. For public drawings, generate on screen in front of the audience.

What exactly is modulo bias, and why avoid it?

The naive way to map a random byte into a range is to take the remainder after dividing by the range size. Unless the range divides the byte count evenly, some results become slightly more likely than others. Rejection sampling avoids this by discarding the few raw values that would cause the imbalance and drawing again, so every number stays exactly equally likely.

Are the numbers inclusive of the minimum and maximum?

Yes, both ends of the range are possible. Setting a range of 1 to 100 can return 1, 100, or anything between, each with equal probability. There is no off-by-one that quietly excludes an endpoint.

How do I pick a random winner from a numbered list?

Set the minimum to 1 and the maximum to the number of entries, then draw one number, that index is your winner. For several winners with no repeats, raise the count and enable unique mode so no index is drawn twice.

Can anyone verify or influence the draw?

It runs locally with OS-grade randomness, nothing external influences it, and no server logs it. For public drawings, generate on screen in front of the audience.

Related generators

From the blog