Random Number Generator - Any Range, No Repeats, Decimals, No Bias

Pick a random number between any two values, from 1 to 10 up to plus or minus 9,007,199,254,740,992.

About this tool

Ask for one number or up to 10,000, allow repeats or make every number different, sort the list, add decimal places and copy the result with the separator you want. The numbers come from your browser's secure random number generator and are drawn without modulo bias, so every number in the range has exactly the same chance. Nothing is sent anywhere.

How it works

The numbers come from crypto.getRandomValues, the random number generator built into your browser. MDN explains that browsers do not use a truly random source for it: they use a pseudo-random number generator seeded with a value with enough entropy, one that is suitable for cryptographic purposes. A true random generator measures a physical process such as electrical noise. A pseudo-random generator is a formula that stretches a small random seed into a long stream. A cryptographic one is designed so that its output cannot be told apart from true randomness by any practical test. MDN also warns that Math.random does not provide cryptographically secure numbers, and this tool never uses it.

A random 32-bit value is a whole number from 0 to 4,294,967,295. Squeezing it into a range by taking the remainder is slightly unfair unless the range divides 4,294,967,296 evenly. Take one random byte (0 to 255) and use it for 0 to 99: 256 is 2 x 100 + 56, so the numbers 0 to 55 each come from three byte values and 56 to 99 from only two, which is 1.17% against 0.78%. This tool uses rejection sampling instead. It finds the largest multiple of the range size that fits, throws away any random value above it and draws again, so every number gets exactly the same count of values. For 1 to 6, only 4 of the 4,294,967,296 values (about one in a billion) are redrawn. Ranges larger than 4,294,967,296 numbers join two 32-bit values, which is how the full plus or minus 2^53 range works.

Decimals are drawn as whole numbers in a scaled range. With 2 decimal places, 0.00 to 1.00 is the whole numbers 0 to 100: the tool draws one of those 101 numbers and writes it back with 2 places. Nothing is divided or rounded, so there are no results like 0.30000000000000004, and 0.37 is exactly as likely as 1.00. If you type more decimal places than the setting allows, the tool asks you to raise the setting instead of rounding for you.

Different numbers (no repeats) are drawn with a partial Fisher-Yates shuffle: one number from all of them, then one from those left, and so on, so every set and order of numbers is equally likely. If the range is too small you get a clear message, for example 11 different numbers cannot come from 1 to 10. With repeats allowed, each draw is independent, so repeats and runs are normal. Ten numbers from 1 to 10 are all different only 10! / 10^10 = 3,628,800 / 10,000,000,000, about 0.036% of the time.

Worked examples

A number from 1 to 100

Leave the defaults (minimum 1, maximum 100, one number) and press Generate again. Each of the 100 numbers has a 1 in 100 chance, 1%, on every press. Seeing the same number twice in a row is normal: it happens about once in every 100 presses.

Six different numbers from 1 to 49

Choose the preset 6 of 49, all different. It turns on the different-numbers option and sorts the result. It is only an example of picking unique numbers. There are 13,983,816 different sets of six numbers from 49 and every set is exactly as likely as any other, so 1, 2, 3, 4, 5, 6 is as likely as any set that looks more random. The tool cannot improve anyone's odds in a real lottery.

A random decimal with 2 places

Set the minimum to 0, the maximum to 1 and the decimal places to 2. The tool draws one of the 101 values 0.00, 0.01 and so on up to 1.00. For a random price between 9.99 and 49.99, use those two bounds with 2 decimal places.

Ten random rows to check in a spreadsheet

To check 10 rows of a 5,000-row sheet, set the range 1 to 5000, ask for 10 numbers, turn on every number different, sort smallest first, choose New line as the separator and press Copy result. Paste the column next to your data.

How many values a range holds and the chance of one particular value in a single draw

RangePossible valuesChance of one particular value
1 to 2 (a coin)250%
1 to 6 (a die)616.67%
1 to 101010%
-5 to 5119.09%
1 to 49492.04%
1 to 1001001%
0.00 to 1.00 (2 decimals)1010.99%
1 to 10001,0000.1%
Sets of 6 different numbers from 1 to 4913,983,8161 in 13,983,816 for any particular set

Frequently asked questions

Is this random number generator really random?

It is as random as your browser's cryptographic generator, crypto.getRandomValues. That is a pseudo-random generator seeded with enough entropy to be suitable for cryptography, not a physical source. For picking numbers, no practical test can tell its output from true randomness, and each number in your range has exactly the same chance.

What is the difference between true random and pseudo-random numbers?

True random numbers come from a physical process such as electrical noise. Pseudo-random numbers come from a formula that starts from a seed. Browsers use the second kind for speed, seeded with enough entropy. Math.random is also pseudo-random, but MDN says it is not cryptographically secure, which is why this tool does not use it.

What is modulo bias and does this tool have it?

Modulo bias is the small unfairness from taking a random value modulo the range size when the range does not divide the number of possible values evenly. Some results then come up slightly more often. This tool avoids it by rejection sampling: values from the uneven leftover part are thrown away and drawn again, so there is no modulo bias.

How do I get random numbers without repeats?

Turn on Every number different. The tool then draws without replacement, so no number appears twice. The range must hold at least as many values as you ask for. If it does not, for example 11 different numbers from 1 to 10, you get an error that says how many values the range has.

Can I use this to pick lottery numbers?

You can pick numbers, but it cannot improve your odds. Every set of six numbers from 49 is equally likely, and there are 13,983,816 sets. For a real lottery or prize draw, follow its own rules. This page is not an approved or audited draw.

How big can the numbers be, and how many can I get?

Each limit can be anything from minus 9,007,199,254,740,992 to plus 9,007,199,254,740,992 (2^53), with up to 10 decimal places, and you can ask for 1 to 10,000 numbers at a time. The last 10 results are kept in the history list.

Why did I get the same number twice in a row?

With repeats allowed, every draw is independent, so repeats are normal. In a range of 10 numbers the next number equals the last one 10% of the time. A number is never "due" because it has not appeared for a while.

Can I use these numbers as a password or an encryption key?

This page is not made for secrets. The numbers are shown in plain text and kept in the on-screen history. For passwords use the password generator, which is built for that.

Are my numbers stored or sent anywhere?

No. The numbers are made in your browser tab and nothing is uploaded, logged or stored. Closing the tab clears the history.

Updated Oct 15, 2026