Random Number Generator

Set a minimum and a maximum and get one random number or up to a thousand. Switch on Unique for a draw without repeats, like lottery balls, or roll dice with any number of sides. Each value in the range has an equal chance, and the numbers never leave your browser.

How to use the Random Number Generator

  1. Enter the lowest and highest value, both included.
  2. Choose how many numbers you want and how many decimal places, if any.
  3. Tick Unique to forbid repeats, or Sorted to list them in order.
  4. Press Generate, then copy the list. For dice, enter the number of dice and sides and press Roll.

Fair and unbiased

Random numbers come from the browser's secure generator, which gives 32-bit values. Taking such a value modulo a range size would make some numbers slightly more likely, so the tool throws away values that fall in the uneven leftover part and draws again. With a range of 6 and 2^32 possible values, 4,294,967,292 values divide evenly and the last 4 would be discarded.

Decimals are made by drawing a whole number of steps. For 0 to 1 with 2 decimal places there are 101 equally likely values, from 0.00 to 1.00, so every step has the same chance.

Unique draws

With Unique on, each number can appear only once, as when drawing numbered balls from a bag. You can ask for at most as many numbers as there are values in the range: 1 to 10 allows up to 10 unique numbers.

Without Unique, repeats are allowed and each draw is independent, like rolling a die several times. Getting the same number twice in a row is normal and does not mean the generator is broken.

Frequently asked questions

Are the minimum and maximum included?

Yes, both can appear.

Can I use this for a prize draw?

It is fair, but you must also follow your local rules for prize draws. The tool leaves no record that others can check.

Why does Unique stop me from asking for 20 numbers from 1 to 10?

Only 10 different values exist, so 20 unique numbers are impossible.

Is it truly random?

It uses crypto.getRandomValues, which is a cryptographically secure source in browsers, not Math.random.

Sources

Last reviewed