Random Number Generator
Generate one or more random whole numbers within any range you choose. Pick how many numbers you want and whether repeats are allowed. Both ends of the range are included, so 1 to 6 can return any face of a standard die.
Your numbers
- Note
How the random numbers are picked
The minimum and maximum are first rounded to whole numbers and swapped if you enter them the wrong way round, so 100 to 1 works the same as 1 to 100. The range size is max minus min plus one: 1 to 100 contains 100 possible values. With duplicates allowed, each number is drawn independently, and every value in the range has the same chance on every draw, so the same number can appear more than once. With duplicates switched off, the calculator lists every value in the range, shuffles that list with the Fisher-Yates algorithm and takes the first N, which gives each possible set an equal chance. Numbers are shown in the order they were drawn, not sorted. You can request up to 1,000 numbers at a time.
With duplicates: each draw is independent. Without duplicates: numbers are drawn from the range without replacement (a Fisher-Yates shuffle of the full range, then take the first N).Worked example. Range 1-100, count 5, no duplicates might produce something like: 7, 42, 88, 13, 61.
The odds behind a random draw
In a range of n whole numbers, each draw has a 1 in n chance of landing on any particular value. For 1 to 100, that is 1%. Repeats are more common than intuition suggests when duplicates are allowed. Drawing 5 numbers from 1 to 100 gives about a 9.7% chance that at least two match, and drawing 10 numbers raises it to about 37.2%. This is the birthday problem: in a group of 23 people, the chance that two share a birthday is about 50.7%. If repeats would be a problem, such as picking several different winners, switch duplicates off. Without duplicates, the number of possible sets grows quickly: choosing 6 numbers from 1 to 49 has 13,983,816 combinations.
Practical uses and how to set them up
To roll a die, set 1 to 6 with a count of 1. For a coin toss, use 1 to 2 and assign heads and tails before you click. To pick raffle winners, number the entries from 1 to the total, set the count to the number of prizes and switch duplicates off so no entry wins twice. To split a class or team into a random order, set 1 to the group size, request that many numbers without duplicates, and read the list as the running order. For a quick random sample from a spreadsheet, generate row numbers within the data range. Decide the rules, such as what happens on a reroll, before generating, so the result cannot be questioned afterwards.
How random is it?
The numbers come from JavaScript's built-in pseudo-random generator (Math.random). It produces sequences that pass standard statistical tests and is well suited to games, classroom activities, sampling and informal draws. It is not a cryptographically secure source, which means it should not be used to generate passwords, encryption keys or anything where a determined attacker could gain from predicting the output. A fair random sequence will also contain streaks and clusters: getting the same number twice in a row from 1 to 10 is a 10% event, not a sign that something is broken. If you need an audited result, such as a regulated lottery or a legally binding prize draw, use a certified service and keep a record of the process.
Questions people ask
Can I generate more numbers than fit in my range without duplicates?
No. If your range only contains, say, 10 possible numbers, you cannot draw 20 unique values from it. The calculator caps the count at the range size, shows all of them in random order, and tells you it has done so.
Is this good enough for something like a raffle or giveaway?
For casual or informal use, yes. For anything requiring cryptographic-grade randomness or provable fairness (like real-money gambling or a legally binding drawing), use a dedicated certified random-number service instead.
Are the minimum and maximum included?
Yes. Both endpoints are part of the range, so 1 to 10 can return 1 and can return 10. There are max minus min plus one possible values.
Can I use negative numbers or decimals?
Negative whole numbers work, for example -10 to 10, which has 21 possible values. Decimals are rounded to the nearest whole number before drawing, so to get decimals, generate integers and divide: 1 to 1,000 divided by 100 gives values from 0.01 to 10.00.
How do I pick a random number between 1 and 10?
Set the minimum to 1, the maximum to 10 and the count to 1. Each of the ten numbers has an equal 10% chance of being chosen.
Put this calculator on your site
Free to use on any site. Please keep the credit link.
<iframe
id="letmecalc-random-number-generator"
src="https://letmecalc.com/embed/math/random-number-generator"
title="Random Number Generator"
width="100%"
height="620"
style="border:0;max-width:100%"
loading="lazy"
></iframe>
<p><a href="https://letmecalc.com/math/random-number-generator" target="_blank" rel="noopener">Random Number Generator</a> by letmecalc</p>
<script>
(function () {
var f = document.getElementById("letmecalc-random-number-generator");
window.addEventListener("message", function (e) {
if (e.origin !== "https://letmecalc.com") return;
if (!f || e.source !== f.contentWindow) return;
var d = e.data;
if (!d || d.source !== "letmecalc-embed" || d.type !== "resize") return;
if (typeof d.height === "number" && d.height > 0) {
f.style.height = d.height + "px";
}
});
})();
</script>