🎲 Random Number Generator

Random integers in any range — great for lotteries, raffles, games and picking winners.

How to use the Random Number Generator

Set a range and a count to generate random numbers, with an option to draw without replacement.

How it works

Web randomness comes in two strengths. Math.random() is fast and suitable for shuffling, sampling and casual draws, but its output is derived from a predictable internal state. crypto.getRandomValues() is a cryptographically secure generator meant for passwords, tokens and keys. Using the wrong one for a security purpose is a real vulnerability, not a theoretical concern.

When to use it

Use it to pick a winner in a giveaway, draw a random sample for research, randomise an order, or generate test data.

Worked example

Choosing the right source for the job:

RequirementCorrect source
Shuffle a listMath.random()
Random sample for surveyMath.random()
Password or API tokencrypto.getRandomValues()
Anything an attacker benefits from guessingcrypto.getRandomValues()

Assumptions and limitations

For a prize draw involving money, record the seed or generation time so the result can be audited afterwards. Use draw-without-replacement when fairness matters, since independent draws can produce the same winner twice. For passwords use the dedicated generator, not this tool.

Frequently Asked Questions

Is this random number generator truly random?

It uses your browser's cryptographic API (crypto.getRandomValues), which is far stronger than Math.random and suitable for games, raffles and drawings.

Can it pick unique numbers only?

Yes — check "No duplicates" and the generator will never repeat a value within one batch, perfect for lottery-style draws.

What is the maximum range?

Any integer range within practical limits — from negative millions to billions. Just make sure the minimum is not greater than the maximum.

🛒 Recommended for You

As an Amazon Associate, Benditools earns from qualifying purchases.