Free online random number generator
A random number generator picks numbers with equal probability across the range you set. Use it for games, lotteries, statistics sampling, or any time you need unbiased random.
Saved to favorites
Your favorites live on the home page, under Your favorites. They're saved only on this device & browser — open the site on your phone or in another browser and you won't see them there. No account, no server.
How to use
- Set the minimum and maximum values for your range.
- Choose how many numbers to generate (1–100).
- Select Integer or Decimal type.
- Check or uncheck Allow duplicates as needed.
- Click Generate to see your random numbers.
How it works
Each number is drawn independently and uniformly from the range [min, max].
For integers without duplicates, the calculator uses a Fisher-Yates partial shuffle:
Place all integers min..max in a pool.
For each position i from 0 to count-1:
pick random j from i..poolLength-1
swap pool[i] and pool[j]
use pool[i] as the next result
For decimals, each value is drawn as:
value = min + Math.random() × (max − min)
rounded to 2 decimal places.
Common uses
- Lottery or raffle draws — pick 6 unique integers from 1–49 (disable duplicates).
- Random sampling — select 20 rows from a list of 500 by generating 20 unique integers from 1–500.
- Game randomization — initiative order, loot drops, event triggers.
- A/B test assignment — decide which variant a user sees by generating 1 integer from 1–2 (or 1–N).
- Pick-one decisions — “heads or tails” is 1–2; “which restaurant” is 1–N where N is your shortlist.
Worked examples
Lottery pick — 6 unique numbers from 1–49
- Min: 1, Max: 49, Count: 6, Type: Integer, Allow duplicates: off
- Sample output: 7, 12, 23, 31, 38, 44
Pick a random winner from 250 entries
- Min: 1, Max: 250, Count: 1
- Output: 187 → entry #187 wins
Monte Carlo test — 10 decimals between 0 and 1
- Min: 0, Max: 1, Count: 10, Type: Decimal
- Output: 0.34, 0.71, 0.12, 0.58, 0.94, 0.03, 0.46, 0.82, 0.27, 0.69
Notes
- Not cryptographically secure — uses the browser’s
Math.random(), fine for lotteries, games, and sampling, but not for passwords, tokens, or anything where predictability could be exploited. Usecrypto.getRandomValues()or a hardware RNG for security. - For very large ranges (e.g., 1 to 1,000,000), duplicate integers are unlikely even when duplicates are allowed.
- The count is capped at 100 to keep results readable.
- Decimal mode always allows duplicates because repeating a specific two-decimal-place value from a wide range is rare.
- Fair vs. uniform — the generator is uniform: every value in the range has equal probability. “Random” doesn’t mean each sequence “feels” random — a run of 7 7 7 is just as likely as 3 8 1 in a wide range.
Frequently asked
Are the numbers truly random?
What does "allow duplicates" mean?
Why does disabling duplicates sometimes give an error?
What is the difference between integer and decimal output?
How do I share a fixed random seed?
Related calculators
- Dice roller
Roll polyhedral dice and calculate the probability of hitting a target number.
- Combinations calculator
Count the number of ways to select items from a set.
- Probability calculator
Calculate probability for simple and compound events.
- Average calculator
Find the mean, median, and mode of a list of numbers.