Random Number Generator
Generate cryptographically secure random numbers
Random Number Generator tool
Range
Options
Random Number Generator: key facts
- What it does
- Generate cryptographically secure random numbers
- Category
- Other Calculators
- Cost
- Free, with no account, sign-up, or install.
- Your data
- Runs entirely in your browser — the files and text you enter are never uploaded to a server.
- Last reviewed
- . Report an incorrect result.
Understanding the Random Number Generator
Whether you are drawing a raffle winner, picking lottery numbers, or seeding a simulation, you need randomness you can trust. This generator produces random numbers within any range you set, using your browser's cryptographically secure random source rather than a basic, predictable one.
It is built for the full spread of needs: generate one number or up to a thousand, allow or forbid duplicates, sort the output, and even produce decimals to a set number of places. Teachers randomize, contest runners draw winners, and developers grab quick test data, then copy the results or download them as a CSV.
Getting a result
- Set the minimum and maximum of your range.
- Choose how many numbers to generate (1 to 1,000) and how many decimal places, if any.
- Tick "unique numbers only" to forbid duplicates, and "sort results" to order them.
- Generate, then copy the numbers or download them as a CSV; recent generations are kept in history.
Scaling into an inclusive range
A random fraction between zero and one is scaled to your range by multiplying by the count of possible values and flooring the result, then adding the minimum. The count is the difference plus one, which is what makes both endpoints reachable — using the difference alone would silently exclude the maximum, a classic off-by-one.
With unique results requested, the generator draws and discards duplicates rather than shuffling a prepared list. There is a cap on attempts — a hundred times the count requested — which prevents an impossible request from looping forever. Asking for more unique values than the range contains is exactly such a request.
The decimal-places option produces values in the same range at finer granularity, which is useful for simulations and test data where integers would be too coarse.
- The defaults draw 10 integers from 1 to 100 inclusive, each of the 100 values equally likely.
- Requesting 6 unique values from 1 to 49 simulates a lottery draw.
- Requesting 20 unique values from a range of 10 cannot be satisfied, and the attempt cap stops the generator rather than hanging.
Reasons to use it here
- It draws from your browser's cryptographically secure random source (crypto.getRandomValues), not the weaker Math.random, so the results are genuinely unpredictable.
- It can enforce unique numbers, sort the output, and produce decimals — covering draws, sampling, and simulation in one tool.
- Results export as CSV or copy to the clipboard, and a history keeps your last several generations.
- Everything runs locally with no account.
Pseudorandom, and not for anything secret
This uses the browser's standard pseudorandom generator, which is deterministic under the hood: an algorithm advancing from an internal seed, producing a sequence that passes statistical tests for randomness without being unpredictable in a cryptographic sense. For picking a winner, shuffling a playlist, generating test data, or settling an argument, that is entirely adequate.
It is not adequate for anything where predictability matters. Passwords, tokens, keys, session identifiers, and anything security-sensitive need a cryptographically secure source, which browsers expose separately and which is what a password generator should use. The distinction is not about the quality of the distribution but about whether an observer who has seen some output can infer the rest.
A note on what randomness looks like. Genuinely random sequences contain clusters and repeats, and people routinely reject them as insufficiently random for exactly that reason. Three consecutive values close together in a draw of ten is unremarkable rather than evidence of a fault — the intuitive expectation of evenly spread results is itself the misconception.
Frequently Asked Questions
Are these numbers truly random?
They are cryptographically secure pseudo-random numbers from your browser's crypto API, which is far less predictable than ordinary random functions. For raffles, sampling, and general use this is effectively random; it is not, however, certified for regulated gambling.
How do I draw numbers without repeats?
Enable "unique numbers only". The generator then ensures no value appears twice — useful for raffles or lottery picks. Just make sure your range is at least as large as the count you request, or unique numbers cannot fill it.
Can it generate decimals, not just whole numbers?
Yes. Set the number of decimal places above zero and the generator returns decimal values within your range, rounded to that precision — handy for simulations or random measurements.
Are the minimum and maximum included in the range?
Yes. For whole numbers the range is inclusive of both ends, so a range of 1 to 10 can produce both 1 and 10. Set the bounds to exactly the smallest and largest values you want to allow.