Compyrix logo

Random Number Generator

Generate random numbers within any range.

Random numbers are essential for everything from selecting lottery numbers and picking contest winners to shuffling lists, statistical sampling, and game mechanics. Our free Random Number Generator uses your browser cryptographically secure PRNG to generate high-quality random numbers within any range.

Configure your generation: set the minimum and maximum values (inclusive), how many numbers you want, whether numbers should be unique (no repeats), and how many decimal places to include (0 for integers, up to 10 for floats). Click Generate to see the results.

The "unique numbers" option is useful for raffles, picking lottery-style numbers, or selecting random winners without duplicates. For example, to simulate a Powerball-style drawing of 5 unique numbers from 1 to 69, set min=1, max=69, count=5, unique=on, decimals=0.

All generation happens in your browser using the Web Crypto API, which is designed to be cryptographically secure and suitable for security-sensitive applications. Unlike the older Math.random(), this generator is not predictable even for attackers who can observe many outputs.

Frequently Asked Questions

Are these numbers truly random?
They are as random as modern computers can produce. We use the Web Crypto API (crypto.getRandomValues) which sources entropy from the operating system CSPRNG. For scientific research, gambling, or cryptographic key generation, this is the standard and recommended method.
Can I generate negative numbers or decimals?
Yes. Set min to any negative number (e.g., -50 to 50) and the generator works symmetrically. For decimals, set the "Decimal places" slider. The range can span zero and include fractional boundaries.
What happens if I ask for more unique numbers than the range contains?
You will receive an error if, for example, you request 10 unique numbers in the range 1 to 5. The set of possible unique results is only 5 elements, so producing 10 is mathematically impossible. Either lower the count or widen the range.
Can I use these numbers as passwords?
For passwords, use our dedicated Password Generator, which is designed with character sets and entropy in mind. Random digits are low entropy per character compared to full passwords, so a random number password would need to be extremely long to be secure.

Related Tools