Home / Math / Random Number Generator

Random Number Generator

Generate one or many random numbers between any two limits. Choose whole numbers or decimals and decide whether repeats are allowed. Randomness comes from the secure generator built into your browser.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

How the numbers are generated

Every number is drawn with crypto.getRandomValues, the cryptographically secure generator that browsers expose. That is stronger than the Math.random function, whose algorithm is not designed to resist prediction.

A common mistake is to take a random 32-bit value and apply the remainder operator, as in x % 100. Because 232 is not a multiple of 100, the smaller results occur slightly more often. This tool avoids that modulo bias with rejection sampling: it masks a random value to the smallest bit width that covers the range and throws it away whenever it falls outside the range, then tries again. Every value in the range is therefore equally likely.

Choosing the options

For small ranges the unique mode shuffles the full list of values with an unbiased partial Fisher-Yates shuffle. For huge ranges it redraws on a clash, which is rare.

Good and poor uses

Reasonable uses include choosing a raffle winner by entry number, assigning people to groups, sampling rows from a list, picking a number for a game, or generating test data. A clear procedure helps: number every entry from 1 upwards, set the range to match, and publish the result.

It is not a licensed lottery, and it should not be your only safeguard for passwords or encryption keys. Dedicated password managers and key-generation tools exist for that. Random sequences also look streaky: seeing the same digit three times in a row is normal and does not mean the generator is faulty.

Limits

The minimum and maximum must lie between -1,000,000,000 and 1,000,000,000, you can request up to 1,000 numbers at once, and decimals go up to six places. The summary rows show the smallest, largest, sum and mean of the numbers drawn in this run. They describe the sample, not the generator, so the mean of a small sample from 1 to 100 will rarely be exactly 50.5.

Worked example

Draw six different whole numbers from 1 to 49, the kind of selection used for a typical lottery-style pick. Each click gives a fresh set.

Inputs

Minimum1
Maximum49
How many numbers6
Type of numberWhole numbers
RepeatsEvery number unique

Result

44, 12, 1, 4, 21, 18

6 numbers between 1 and 49, all different.

Possible values in range49
Smallest generated1
Largest generated44
Sum of generated numbers100
Mean of generated numbers17
Sorted list1, 4, 12, 18, 21, 44

Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.

Frequently asked questions

Is this random number generator truly random?

It uses the secure random source supplied by your browser or operating system, which is designed to be unpredictable. It is a high-quality pseudo-random source rather than a physical dice or radioactive decay.

What is modulo bias and why does it matter?

Taking a random value modulo a range that does not divide evenly makes some outcomes slightly more likely. Rejection sampling discards the awkward values so that every outcome has exactly the same probability.

Can I generate numbers without repeats?

Yes. Choose the unique option and the tool draws without replacement. It returns an error if you ask for more unique numbers than the range contains, for example 11 unique numbers from 1 to 10.

Are the minimum and maximum included?

Yes, both limits can appear. For whole numbers between 1 and 6 each of the six values has the same chance, just like a fair die.

Can I use this for a giveaway draw?

Yes, as a fair way to pick an entry number. Decide the entry numbering and the rules before you draw and keep a record, so that others can see the process was not changed afterwards.

Mean, Median, Mode CalculatorMean, median, mode, range, quartiles and IQR for a list of numbers, with the quartile method stated.Average CalculatorSimple mean, weighted average, and the score needed on remaining work to reach a target average.Factorial CalculatorExact n! and n!! up to 1,000, with digit count, trailing zeros and a Stirling check.Percentage CalculatorPercent of a number, percent change, and increase or decrease by a percent, with working.

References and sources

  1. NIST SP 800-90A: recommendations for random number generation using deterministic random bit generators.
  2. Web Crypto API specification, Crypto.getRandomValues, published by the W3C. Link

Check primary sources for anything you rely on.