Format Code Now
/

Random Number Generator

RG-16

Type the lowest and highest number, press Generate, and get as many random numbers as you need. Whole numbers or decimals, with or without repeats, all made in your browser.

Runs in your browser. Nothing is uploaded.

Optional: lowest and highest number, for example 1 100 (empty means 1 to 100)

Random numbers

How to use it

  1. Type the lowest and highest number in the box, for example 1 100. Leave it empty for 1 to 100.
  2. Choose how many numbers you want, from 1 up to 1000.
  3. Set decimal places, tick No repeats if each number must be different, and pick the order and separator.
  4. Copy the list or download it as a text file.

How the numbers are picked

Every number comes from crypto.getRandomValues, the random source built into your browser. A plain remainder of a random number would favor some values, so values that would cause that are thrown away and drawn again (rejection sampling). The lowest and the highest number are both included. Decimals work the same way: with 2 places, every step of 0.01 from the lowest to the highest is equally likely, and the result always shows 2 places.

Big ranges and no repeats

Numbers are handled as exact integers, so a range such as 1 to 99999999999999999999 is not rounded the way a normal JavaScript number would be. Ticking No repeats gives different values. If you ask for more unique numbers than the range holds, for example 10 unique numbers between 1 and 3, the tool stops with an error and tells you how many values the range has. Small ranges are shuffled, so even asking for every number in the range is quick.

Error messages and what to do

MessageWhat it meansFix
Enter two whole numbers: the lowest and the highest, for example 1 100.The box holds one number, or three or more.Type exactly two whole numbers, or clear the box to use 1 to 100.
The lowest number is higher than the highest number.The first number you typed is larger than the second.Swap the two numbers.

Questions people ask

Are the numbers truly random?

They come from the random generator that your browser provides for cryptography, which is far better than Math.random for fairness. A computer cannot give physical randomness, but this source is suitable for games, samples and test data.

How do I get a random number between 1 and 10?

Type 1 10 in the box, set How many to 1, and press Generate. Both 1 and 10 can come up. For a different range, change the two numbers; negative numbers such as -5 5 also work.

Can I generate random decimals?

Yes. Pick Decimal places from 1 to 6. With 2 places and a range of 0 to 1, you get values like 0.37 or 0.05, each step equally likely. The count of decimal places is fixed, so 0.50 stays 0.50.

How do I make sure no number repeats?

Tick No repeats. The tool then draws different values only. If the range has fewer values than you asked for, it shows an error with the number of values in the range instead of repeating some.

Is it safe to use for a lottery or a password?

It is fine for picking a winner from a list or sampling rows. Do not rely on it for lotteries run for money, or for secrets. For passwords, use a password generator that mixes character sets and is made for that.

Can I get the numbers separated by commas?

Yes. Choose Comma, Space, Semicolon or Tab under Separator instead of New line. You can also sort the list smallest first or largest first before you copy it.

About this tool

Values are made in your browser with crypto.getRandomValues and rejection sampling, so no value is favored, and nothing is sent anywhere or stored. Type two whole numbers (the lowest and the highest, both included) in the box, separated by a space, comma or the word to; negative numbers work. With decimal places set, every value from the lowest to the highest in steps of that size is equally likely, and numbers are written with exactly that many places. Whole numbers and decimals are handled as exact integers, so a range such as 1 to 99999999999999999999 is not rounded. "No repeats" gives different values and stops with an error if the range holds fewer values than you asked for. It is not meant for lotteries, gambling or keys; for secrets use the password generator.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.