Skip to content
MyDailyTool

Random Number Generator

Generate a random number in any range — integers or decimals, with optional no-repeat mode. Useful for picking lottery numbers, random sampling, and game mechanics.

How to use the random number generator

Pick a min, max, and count. Toggle 'unique' to disallow repeats.

Formula & explanation

Numbers come from window.crypto.getRandomValues — a CSPRNG, not Math.random — so they're suitable even for sensitive uses.

Examples

Pick 6 unique numbers between 1 and 49 for lottery; pick 100 numbers between 0 and 9 for a sample.

Frequently asked questions

Is this truly random or pseudorandom?
The generator uses window.crypto.getRandomValues, a cryptographically secure pseudorandom number generator (CSPRNG) built into modern browsers. It is statistically indistinguishable from true randomness for all practical purposes.
Can I use this for lottery picks?
Yes. Enable the 'Unique' checkbox, set Min and Max to your lottery range (e.g. 1–49), set Count to the number of balls drawn, and click Generate.
What does 'Unique' do?
When checked, no number appears more than once in the result set. The range (Max − Min + 1) must be at least as large as Count, otherwise no results are returned.
Why is Math.random not used here?
Math.random is a fast but non-cryptographic PRNG whose output can sometimes be predicted. crypto.getRandomValues is unpredictable and suitable for security-sensitive applications like token generation or fair draws.

Related generators tools