Random number generator.
Generate one or many random numbers in any range. Choose how many, allow or block duplicates, sort the results, and pick integers or decimals. Hit generate as many times as you like.
Set the range
LivePress Generate for a fresh set. With duplicates off, you cannot ask for more integers than the range holds.
Your random numbers
These are pseudo-random numbers, fine for picks, draws and games, but not for security or cryptography. Generated in your browser; nothing is stored.
How it works
Numbers, on demand
Set a lower and upper limit and how many numbers you want. Each integer is picked by scaling the browser random function across your range, so every value in the range is equally likely. Turn off duplicates and the generator instead shuffles the whole range and deals you the first few, so no number repeats.
Switch to decimals for values with two decimal places, and sort the output low to high or high to low. Every press of Generate gives a brand new set.
Quick ranges
One-tap presets.
Common ranges, set up for you. Tap one to load it into the generator above and roll a fresh set.
The full guide
The complete guide to random numbers.
How the generator works, how to avoid repeats, and where pseudo-random numbers are and are not the right tool.
What is a random number generator?
A random number generator produces numbers from a range with no pattern you could predict, each value as likely as any other. This one lets you set the lowest and highest value, choose how many numbers to draw, and decide whether repeats are allowed. It is handy any time you need an unbiased pick.
The numbers are spread evenly across your range, so over many draws each value turns up about as often as the rest.
How to use it
Enter a lower and upper limit, then how many numbers you want. Leave duplicates on if a value may appear more than once, like rolling dice, or turn them off when each pick must be unique, like a raffle. Choose integers for whole numbers or decimals for two-place values, and sort the results if order helps.
Press Generate for a fresh set at any time. The quick-range presets above fill in common setups, from a single dice roll to a six-from-forty-nine lottery line.
Generating without duplicates
When you switch duplicates off, the generator does not just reroll until numbers stop clashing. For integers it builds the full list of values in your range, shuffles it, and hands you the first few. That guarantees every number is different and keeps it fast even for large draws.
Because of that, with duplicates off you cannot draw more integers than the range contains. Asking for ten unique numbers from one to five simply returns the five that exist.
Pseudo-random versus true random
Computers usually produce pseudo-random numbers: an algorithm generates a sequence that looks random and passes most statistical tests, but is ultimately determined by a starting seed. This generator is pseudo-random, which is perfect for games, draws, sampling and everyday picks.
True random numbers come from physical sources such as atmospheric or thermal noise, and need extra steps to remove bias. They matter for cryptography and security, where a predictable sequence would be dangerous.
When not to use it
Do not use a pseudo-random generator for anything security-sensitive: passwords, encryption keys, tokens or anything an attacker might try to predict. For those, use a cryptographically secure generator or a dedicated tool built for the job.
For raffles, team picks, test data, dice and lotteries, a generator like this one is exactly right.
Common uses
People reach for random numbers to draw raffle and giveaway winners, pick a sample from a list, assign people to groups, settle a decision fairly, roll dice or generate lottery lines, and create test data. The duplicate and sort options cover most of these without any extra work.
If you need the same set again later, jot the numbers down, since each press of Generate produces a new independent draw.
Under the hood
Even odds,
every value.
Each integer is the browser random value scaled across your range, so every number is equally likely. No duplicates means a shuffle, not a reroll.
Try the average calculator ›# Integer in [min, max]
n = floor( random() × (max − min + 1) ) + min
# random() returns 0 ≤ x < 1
# No duplicates
shuffle the whole range, take the first NQuestions
Random questions.
How do I generate random numbers in a range?
+
Enter a lower and upper limit and how many numbers you want, then press Generate. Each number is picked evenly from the range, so every value is equally likely. Use the presets for common ranges like dice or a lottery line.
Can it generate numbers without duplicates?
+
Yes. Switch duplicates off and every number in the set will be unique. For integers it shuffles the whole range and takes the first few, so you cannot draw more numbers than the range contains.
Are these numbers truly random?
+
They are pseudo-random, produced by the browser, which is ideal for games, draws, sampling and everyday picks. They are not suitable for passwords, security or cryptography, which need a cryptographically secure source.
Can I generate random decimals?
+
Yes. Set the number type to decimals and the generator returns values with two decimal places within your range, instead of whole numbers.
Is this random number generator free and private?
+
Yes. It is completely free with no sign-up, and every number is generated locally in your browser, so nothing you enter is stored or sent anywhere.
About the developer
Jean Borg
Jean builds and maintains every calculator on freecalculators.pro from Malta, with a focus on tools that are fast, free and show their working. This generator produces pseudo-random numbers for everyday use and is not intended for security or cryptographic purposes.