Free tool
Random Number Generator
Generate random integers or decimals between any minimum and maximum, with unique draws and sorting. Uses crypto.getRandomValues with no modulo bias.
- Your random numbers
- –
- Possible values in the range
- –
- Sum (whole numbers)
- –
Assumptions and limits
Nothing is built in except the method: every result comes from your limits and your browser's random source.
- Randomness comes from your browser's crypto.getRandomValues function. This page does not generate or test those bits; it only turns them into numbers.
- Numbers in a range are chosen by rejection sampling: draw only as many bits as the range needs and redraw whenever the value is outside it. No modulo is used, so no number is favored.
- Both the minimum and the maximum can be drawn. Decimals are drawn on an even grid with the number of places you choose.
- Unique draws never repeat, so you cannot ask for more numbers than the range holds. Up to 1,000 numbers are generated per click, in a range of at most about nine quadrillion values.
- Results exist only on this page and are not stored or sent anywhere. This tool is for everyday picks, not for passwords or keys.
Runs entirely in your browser. Nothing you type or upload is sent to our servers.
How the random numbers are drawn
The tool needs a whole number from 0 up to one less than the size of your range. It works out how many bits cover that size, reads that many bits from the browser's random source, and checks whether the value is inside the range. If it is, the value is used. If not, the value is discarded and fresh bits are drawn. Because every accepted value came from an equally likely bit pattern, every number in the range has the same chance. The result is then shifted by your minimum, so 1 to 6 is the draw 0 to 5 plus 1.
Worked example 1: rolling one die (1 to 6)
- Six outcomes need 3 bits, because 2² = 4 is too few and 2³ = 8 covers six. The raw draw is a whole number from 0 to 7.
- Values 0 to 5 are accepted. Values 6 and 7 are discarded and redrawn, which happens 2 ÷ 8 = 25% of the time. On average that takes 8 ÷ 6 = 1.33 draws per roll.
- Each accepted value is 1 in 6 (16.67%). Adding the minimum of 1 turns 0 to 5 into 1 to 6.
Why not use the remainder? 4,294,967,296 values divided into 6 groups is 715,827,882 per group with 4 left over, so remainders 0 to 3 would have one extra chance each. The gap is tiny, but rejection sampling removes it entirely.
Worked example 2: six different numbers from 1 to 49
- The range holds 49 values. A unique draw takes one value, removes it, then draws from the 48 left, and so on.
- The number of ordered ways to pick six is 49 × 48 × 47 × 46 × 45 × 44 = 10,068,347,520.
- The order of the six does not matter, so divide by 6! = 720: 10,068,347,520 ÷ 720 = 13,983,816 different sets, each equally likely.
Tick "Unique numbers", set 1 to 49 and ask for 6 numbers, with "Smallest first" to read the set easily.
Tips for common uses
- Dice: set 1 to 6 and the number of dice as "how many", with repeats allowed.
- Samples: use unique numbers from 1 to the number of rows, then pick those rows.
- Decimals: a 0 to 1 range with 4 places gives a probability-style value on a 10,001-step grid.
Related tools
Choosing between names or options instead of numbers? Use the Wheel Spinner. For passwords, use the Password Generator. To add up or check the numbers you drew, open the Scientific Calculator.
Frequently asked questions
How does this random number generator pick numbers?
It asks your browser for random 32-bit values with the crypto.getRandomValues function, keeps only as many bits as the range needs, and throws away any value that falls outside the range before asking again. That method is called rejection sampling. It gives every number in your range exactly the same chance. The quality of the raw random bits comes from your browser and operating system; this page does not generate them itself.
What is modulo bias and why does this tool avoid it?
Many generators take a big random number and use the remainder after dividing by the range size. Unless the range divides the big number evenly, some results come up slightly more often. For 1 to 6 with 32-bit values, 4,294,967,296 is 6 × 715,827,882 plus 4, so four of the six results would get one extra chance each. Rejection sampling removes that gap completely.
Can I get numbers that never repeat?
Yes. Tick "Unique numbers (no repeats)" to draw without replacement, like pulling numbered balls from a bag. You can ask for at most as many numbers as the range holds: 10 unique numbers from 1 to 10 returns every number once in random order. If you ask for more than exist, the tool tells you how many are possible instead of repeating.
Are the minimum and maximum included?
Yes, both ends are possible. A range of 1 to 6 can return 1, 6 and everything between. With decimals the same is true: 0 to 1 with 2 decimal places has 101 possible values, from 0.00 to 1.00, and each has the same chance. If you would rather exclude an end, shift the limit by one step, for example 2 to 6.
How do decimals work?
Decimals are drawn on an even grid. With 2 decimal places and a range of 0 to 10, the tool picks a whole number from 0 to 1,000 uniformly, then divides by 100, so every value such as 3.07 or 9.99 is equally likely. You can choose 1 to 6 places. The results show exactly that many digits, including trailing zeros.
How many numbers can I generate at once, and how large can they be?
Up to 1,000 numbers per click. Whole-number limits can reach about nine quadrillion (the largest exact whole number the page can store), and the range between them must stay within that size. Negative numbers are fine, for example -50 to 50. The sum shown for whole numbers is hidden if it would be too large to be exact.
Should I use this for passwords or security keys?
Use the Password Generator for that. It builds strings from character sets and shows their strength. This tool is meant for everyday choices: dice rolls, sample picks, practice problems, games and tie-breaks. Results are not stored, so copy them if you want to keep them.
Is anything I enter stored or sent anywhere?
No. The numbers are produced in your browser and are not sent to our servers or saved. The page records only that the tool was used, without your limits or results. Reloading the page clears them.
Link to this tool
Found it useful? Copy a link for your page, newsletter or documentation.
Get new tools and guides by email
Optional. The tool above works without signing up.
More free tools
Browse all everyday calculators or the full list of free tools.
- Wheel SpinnerType your own names or options, spin the wheel and get a fair random pick, with an optional remove-the-winner mode and a history of spins.
- Scientific CalculatorCalculate with trig in degrees or radians, logs, roots, powers and factorials, using the correct order of operations, with memory, history and keyboard input.
- Area CalculatorFind the area of 13 shapes, from rectangles and circles to ellipses, regular polygons and rings, in six units, with the formula and working shown.
- Unit ConverterConvert length, weight, temperature, volume, area, speed and data size with exact factors, such as 1 inch = 2.54 cm. Includes inches to cm and kg to lbs.
- Square Footage CalculatorFind the area of a room, L-shape, triangle, circle or trapezoid in square feet, yards and meters, with a waste allowance and a package count.
- Concrete CalculatorEstimate concrete for slabs, footings, columns and steps in cubic yards and meters, with a waste allowance and bag counts from the yield you enter.