Random number generator — pick numbers in any range

Set a minimum and a maximum and the tool draws random numbers between them, both ends included, using your browser's cryptographic random source. Whole numbers by default, or up to 6 decimal places.

Live demo · real result from this tool
0 gives whole numbers. With decimals, every value on that grid (for example 0.01 steps) is equally likely.

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the random number generator

  1. Enter the Minimum and Maximum. Both are included in the draw.
  2. Set How many numbers you want, from 1 to 1,000.
  3. Tick No repeats if each number may appear only once, and Sort ascending if you want the list in order. Set Decimal places above 0 for numbers such as 0.37 or 4.125.
  4. Press Generate. The first number is shown large, the full list appears underneath, and you can copy it.

What it does and when to use it

This is the digital version of drawing numbered tickets from a hat. Use it to choose a raffle ticket, pick a random page or question number, assign seats, roll a die with an unusual number of sides, or create test data for a spreadsheet. With No repeats ticked it behaves like a lottery machine: each number can come out only once.

For other kinds of draws there are dedicated tools. The lottery number generator knows common game formats, the dice roller reads notation such as 2d6+3, and the spinner wheel picks from names instead of numbers.

How it works

The tool asks the browser for random 32-bit values with crypto.getRandomValues. That source is designed to be unpredictable, unlike Math.random, which is a fast formula that someone could in principle predict after seeing enough output.

Turning a 32-bit value into a number between, say, 1 and 6 needs care. Taking the remainder after dividing by 6 would make some numbers very slightly more common, because 2³² does not split evenly into 6 parts. This is called modulo bias. The tool avoids it with rejection sampling: any raw value that falls in the uneven leftover band is thrown away and a new one is drawn. Every number in your range ends up with exactly the same chance.

With No repeats, the tool keeps drawing and skips any number it has already produced until it has the amount you asked for. Sort ascending only changes the order of the list, not which numbers were drawn.

Worked examples

These outputs come from the tool’s own function.

Shuffling a die’s faces. Minimum 1, maximum 6, how many 6, with No repeats and Sort ascending both ticked. Every face must appear once, so the sorted list is always 1, 2, 3, 4, 5, 6. Untick Sort ascending and you get the same six numbers in a random order, which is a quick way to shuffle six items.

Decimal limits, whole numbers. Minimum 1.5, maximum 9.7, Decimal places 0. The tool rounds the minimum up and the maximum down and reports Range: 2 to 9 (inclusive), then draws one whole number from that range.

Decimal places. Minimum 1.5, maximum 2, Decimal places 1, how many 6, No repeats and Sort ascending ticked. There are exactly six values on the 0.1 grid, so the list is always 1.5, 1.6, 1.7, 1.8, 1.9, 2.0.

Limits and tips

  • Decimals sit on a grid. With 2 decimal places the tool picks among 0.01 steps; it does not produce values like 0.123 unless you ask for 3 places. For random dates, letters or names, use the matching generator instead.
  • Repeats surprise people. This is the birthday problem: in a group of independent draws, a shared value turns up much sooner than intuition suggests. That is correct behaviour, not a fault.
  • Ranges with no whole number (such as 2.2 to 2.8) return a message instead of a result.
  • Keep the first result for anything other people care about. Drawing again until you like the answer makes any generator unfair.
  • Nothing you enter is sent anywhere; the numbers are made on your device.

Frequently asked questions

Are the minimum and maximum included?
Yes. A range of 1 to 100 can return both 1 and 100. The result always repeats the range back to you, for example "1 to 100 (inclusive)".
Why do I get the same number twice?
Each draw is independent, so repeats are normal. If 20 numbers are drawn from 1 to 100, the chance of at least one repeat is about 87%. Tick "No repeats" if every number must be different.
Is this random enough for a giveaway or raffle?
It uses crypto.getRandomValues, the browser's cryptographic random source, and avoids modulo bias, so every number in the range is equally likely. For a public draw, agree the range and the rules before you press Generate and keep the first result.
Can it make decimal numbers?
Yes. Set Decimal places to 1–6. The tool then draws from every value on that grid, so 0 to 1 with 2 decimal places can return any of 0.00, 0.01 … 1.00, each equally likely. With Decimal places at 0, decimal limits shrink to the whole numbers inside them, so 1.5 to 9.7 becomes 2 to 9.
What is the most numbers I can draw?
Up to 1,000 per click. With "No repeats" ticked you cannot ask for more numbers than the range holds; 1 to 10 has only 10 distinct values, and the tool tells you so.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close