Random Number Generator

Generate random numbers in any range. Support for unique-only draws, sorting, and instant statistics — mean, median, min, max and sum. All processing runs in your browser.

Set your range and click Generate to draw random numbers.

How the Random Number Generator Works

Our random number generator runs entirely in your browser. No numbers, ranges, or generated data are ever transmitted to a server. This makes it safe for classroom exercises, classroom lottery draws, dice simulations, raffles, statistics homework, and quick prototyping where you want to keep your inputs private.

The tool supports the full JavaScript safe-integer range (from -9,007,199,254,740,991 up to 9,007,199,254,740,991), though for performance we cap a single draw at 100,000 numbers. When the unique only option is on, the generator performs a uniform shuffle over the requested range — every value in the range has an equal probability of being selected, with no repeats.

Understanding the Statistics

Every time you generate numbers, the tool computes five summary statistics over the draw:

These statistics update instantly as you regenerate. For large samples (thousands of numbers) the distribution of values should hover close to the midpoint of your range — a quick visual check that randomness is working as expected.

Crypto-Grade vs. Fast PRNG

By default this generator uses crypto.getRandomValues(), the Web Crypto API's cryptographically strong pseudo-random number generator (CSPRNG). This is the right choice when the output must be unpredictable — for example raffle draws, token samples, or any context where someone might try to predict the next number.

If you uncheck Use crypto-grade randomness, the tool falls back to Math.random(), which is much faster but should not be used for security-sensitive work. For most casual use cases (dice rolls, game prototyping, sampling) Math.random() is perfectly adequate.

FAQ

Are the generated numbers truly random?
No web tool can produce truly random numbers from physical entropy. The default mode uses crypto.getRandomValues(), a cryptographically strong pseudo-random generator seeded by the operating system. It is unpredictable enough for raffles, lotteries, and security-sensitive sampling.
What happens when "unique only" is checked?
The generator draws without replacement — no value can appear twice in the output. The quantity you request cannot exceed the size of the range (max - min + 1). If it does, the tool shows an error explaining the limit.
What is the largest range I can use?
Any integer between the JavaScript safe-integer limits (-9,007,199,254,740,991 and 9,007,199,254,740,991) is accepted. However, when unique only is enabled and the range is very large, memory usage grows with the range size — for ranges over a few million values we recommend unchecking unique-only.
Can I generate decimals or floating-point numbers?
This tool generates integers, which covers the vast majority of random-number use cases (dice, lottery, sampling, raffles). For floating-point values you can divide the output by a power of ten in your own code, or use a spreadsheet on the copied results.
Is any of my data sent to a server?
No. Every calculation — generation, statistics, copy-to-clipboard — happens locally in your browser. You can use this tool offline once the page has loaded.

Related Tools