Draw uniformly distributed whole numbers in an inclusive range.
Use this tool for random selection, classroom sampling demonstrations and game draws. Set inclusive lower and upper bounds and choose how many independent draws to make. For a roster, map integers to numbered rows before drawing.
How to use the random number generator
Set inclusive lower and upper bounds and choose how many independent draws to make. For a roster, map integers to numbered rows before drawing.
The form starts with a demonstration you can run immediately. Its starting inputs are Minimum = 1; Maximum = 100; Draws = 5. Replace these values with your own and select Generate. Results appear underneath the buttons. Select Reset to restore the example. If you receive a validation message, check the field formats and try again.
What the calculation measures
A draw can produce either endpoint. Each eligible integer has the same chance at each draw. Repeated values are possible because numbers are sampled with replacement.
A fair selection without replacement requires removing prior winners from the pool. Discarding repeats after an unrestricted draw changes what the displayed sequence represents.
The generator uses the browser random source and rejection sampling to avoid favoring certain numbers when the range does not evenly divide the source range.
Worked example and comparison cases
The examples below specify test settings. The generated text or sequence changes between runs, so use the stated input rules to check the output.
Starting example
Enter Minimum 1; Maximum 100; Draws 5. Check that the result contains 5 draws and that every number falls between 1 and 100, inclusive. This is the starting scenario shown in the form.
The default is an inclusive range of one to one hundred. Looking at one short sequence cannot tell you whether the generator is unbiased. Independence allows clusters and repeated values.
Comparison 1
Enter Minimum 1; Maximum 6; Draws 1. Check that the result contains 1 draw and that every number falls between 1 and 6, inclusive. Compared with the starting example, this case changes Maximum, Draws.
One draw from one to six corresponds to one roll of a numbered die. Each observation lies in that six-value space. Assign each side a unique number if you are using this for a demonstration.
Comparison 2
Enter Minimum 1; Maximum 20; Draws 4. Check that the result contains 4 draws and that every number falls between 1 and 20, inclusive. Compared with the starting example, this case changes Maximum, Draws.
Four draws from a roster of twenty may select the same row twice. Decide in advance whether this is allowed. Use a shuffle or other documented no-replacement method when four different people must win.
Comparison 3
Enter Minimum -5; Maximum 5; Draws 8. Check that the result contains 8 draws and that every number falls between -5 and 5, inclusive. Compared with the starting example, this case changes Minimum, Maximum, Draws.
A range can pass through zero and retain the same probability rule. In this case zero and each positive or negative endpoint are as eligible as the other whole numbers within the limits.
Comparison 4
Enter Minimum 7; Maximum 7; Draws 3. Check that the result contains 3 draws and that every number falls between 7 and 7, inclusive. Compared with the starting example, this case changes Minimum, Maximum, Draws.
Identical endpoints leave a range with only one possible value. Asking for three draws in this case should return that value three times, which is a useful boundary check.
Check the inputs against your source
Write down where the inputs came from before relying on the result. If you copied numbers from two records, make sure the records describe the same person, transaction, period or dataset. Work from the original values if possible. A rounded amount shown in a report may be adequate for a quick check, but reusing several rounded values can move the final answer enough to matter.
For this calculation, start by checking minimum, maximum, draws. A fair selection without replacement requires removing prior winners from the pool. Discarding repeats after an unrestricted draw changes what the displayed sequence represents. If a source uses a different definition, record the two calculations separately so that you can explain any discrepancy. Before sharing the result, include the inputs alongside it so the next reader can reproduce it without guessing what you entered.
Compare scenarios without losing the baseline
Save the starting inputs and outputs before editing a value. Change one assumption, then read the result against your baseline. When several inputs need to change together, write down the reason for those changes and treat them as a separate scenario. This is especially useful when two people are comparing results from different documents or when the source data might be revised later.
The generator uses the browser random source and rejection sampling to avoid favoring certain numbers when the range does not evenly divide the source range. It helps to choose a realistic alternative, such as an actual quoted figure, a measurement in the correct unit, or another value supported by your dataset. Compare the magnitude of the difference as well as its direction. Small differences can be down to rounding. Larger differences are a reason to review whether the two scenarios started from comparable inputs.
Common questions
What should I do if I get a different answer elsewhere?
Replicate the inputs shown in the worked example first. If the result agrees there, check your own entry against the source values and compare the two methods. Pay particular attention to units, inclusions and any rounding convention. A draw can produce either endpoint. Each eligible integer has the same chance at each draw. Repeated values are possible because numbers are sampled with replacement.
How much precision should I keep?
Keep source values unrounded when you can. Choose the precision you report based on the question you are answering. For example, a figure you are using in a later calculation may need more digits than a figure you are giving in a quick summary. If a policy or quote supplies a rounding rule, compare your result using that rule.
Can I reuse the result when an input changes?
Recalculate when the measurement, quote or assumption changes. Record the prior result if it was part of a decision or report. A dated record makes it possible to compare the two runs accurately and see which difference came from a new input rather than an earlier entry mistake.