What this calculator does
Get a fair random number, or a whole set of them, from any range you choose. Every allowed number has the same chance of coming up. People use it to pick a raffle winner, split people into groups or choose a question to answer. It can also settle who goes first, or pick items from a numbered list.
Set the smallest and largest number, choose how many you want, and press Generate. You can draw whole numbers or decimals and sort the results. You can also ask for no repeats, like pulling tickets out of a hat without putting them back.
Each press starts from a fresh seed, the starting value that sets off a new sequence. The seed comes from your browser's secure random source, so nobody can guess the numbers in advance.
Where it's used
Why this math matters outside the classroom:
- Calling on students. A teacher draws a number from 1 to 28 to call on a student, giving each student a 1/28 chance.
- Raffle draws. Organizers draw 3 numbers from 1 to 500 with no repeats so that no ticket can win twice.
- Simulations. Students simulate 100 coin flips by drawing 0 or 1 each time and compare the share of heads with 1/2.
- Random samples. A researcher picks 50 of 2,000 customer IDs at random so every customer has the same chance of being chosen.
- Who goes first. Four friends draw a number from 1 to 4 to decide who goes first, so each has a 25% chance.
Grade level and standards: Grade 7; Common Core State Standards for Mathematics 7.SP.C.7.a. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.
How to use it
- Choose whole numbers or decimals. For decimals, pick how many decimal places each number should have.
- Enter the minimum and maximum. Both ends are included, so 1 to 10 can give 1 or 10.
- Set how many numbers you need. Tick No repeats if each value may appear only once. Tick Sort to list them from smallest to largest.
- Press Generate. Press it again for a new draw. Your recent draws are listed under the button.
What the inputs mean
- Minimum
- This can be negative. In whole-number mode, it must be a whole number.
- Maximum
- This number can come up too. If it equals the minimum, you'll always get that one value.
- How many numbers
- Up to 1,000 numbers per draw. With No repeats, you can't ask for more numbers than the range holds.
- Decimal places
- Decimals come in evenly spaced steps. With 2 places, 0 to 1 means the 101 values 0.00, 0.01, … 1.00, each equally likely.
- No repeats (each number can come up only once)
- Without this, the same number can come up more than once, as if each ticket goes back in the hat before the next draw.
Formula and method
possible values n = maximum − minimum + 1 (whole numbers) possible values n = ⌊max × 10^d⌋ − ⌈min × 10^d⌉ + 1 (d decimal places) number = minimum + k, where k is a whole number from 0 to n − 1, each with probability 1/n chance of a given value on one draw = 1 ÷ n chance a given value is among k draws with no repeats = k ÷ n
In the formulas, n is how many different values can come up, and d is the number of decimal places. The ⌊ ⌋ brackets mean round down to a whole number, and ⌈ ⌉ mean round up. In the third line, k is the random whole number added to the minimum. In the last line, k is how many numbers you draw.
The generator first counts how many values are allowed. Then it picks one of them, giving each the same chance. Squeezing a big random number into a smaller range can give some values a tiny edge. To prevent that, the generator throws away any raw draw that would favour some values, and draws again. This is called rejection.
Draws with no repeats use Floyd's sampling method. It picks different values directly, without listing the whole range. So even a range of a trillion numbers is handled instantly. The chosen numbers are then shuffled, so their order is random too.
Worked example
A teacher wants to call on 3 different students from a class list numbered 1 to 25.
- Range: 25 − 1 + 1 = 25 possible numbers.
- Set How many numbers to 3 and tick No repeats, so nobody is picked twice.
- Each draw lists three different numbers from 1 to 25, for example 14, 3, 22.
- Any particular student has a 3 ÷ 25 = 12% chance of being in a given draw.
Result: Three distinct student numbers, with each student equally likely (12%) to be chosen.
Understanding the result
Random results often look less random than people expect. Runs such as 7, 7 or 1, 2, 3 happen all the time in fair draws. And a short run that seems to favour some numbers tells you nothing about the next draw.
The chance shown is for each draw. With repeats allowed, drawing the same number twice in a row has a chance of 1/n × 1/n, not zero. Here n is the number of possible values.
Assumptions and limitations
- Every value in the range is equally likely. Each draw is independent of the others (unaffected by earlier draws), unless No repeats is ticked.
- Seeds come from the browser's secure random source, crypto.getRandomValues. The numbers themselves come from a fast, well-tested pseudo-random generator called xoshiro128**.
- This tool is for games, classrooms, sampling and informal draws. It isn't certified for regulated lotteries or prize draws that need an audited process.
- Don't use it to create passwords or security keys. Use a dedicated password manager or generator instead.
- Ranges are limited to ±1 trillion. Very wide ranges with many decimal places may be too large to store exactly.
Frequently asked questions
Are these numbers truly random?
Each draw starts from a seed taken from your device's secure random source, which is unpredictable. That seed then drives a pseudo-random generator. It follows a fixed recipe, but its output is spread very evenly. For everyday picking and sampling, the results are as good as random.
How do I pick a number between 1 and 10?
Leave Whole numbers selected, set the minimum to 1 and the maximum to 10, and press Generate. Both 1 and 10 can come up, each with a 10% chance.
How do I draw lottery-style numbers?
Set the range of the game, for example 1 to 49. Set How many numbers to the number of balls drawn, then tick No repeats and Sort. This mimics a draw. But it has no connection to any real lottery, and it doesn't improve anyone's odds.
Why did the same number come up twice?
With repeats allowed, each draw ignores the ones before it, so duplicates are normal. In 1 to 100, two numbers drawn will match about 1% of the time. With 20 numbers, a repeat somewhere is more likely than not. Tick No repeats to prevent it.
How this calculator is checked
Method: Uniform discrete sampling with rejection to remove modulo bias; Floyd's algorithm for sampling without replacement; xoshiro128** generator seeded via splitmix32 from crypto.getRandomValues. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Random Number Generator on your own website or blog for free. Paste this code where you want it to appear: