X-Calculator
Math Updated November 23, 2026

Random Number Generator

Pick random numbers in any range, with or without duplicates, as whole numbers or decimals.

Minimum
Maximum
How many numbers
Decimal places
Duplicates
Sort results
Advertisement
Advertisement

This random number generator picks one or many random numbers between any minimum and maximum you choose. Draw whole numbers or decimals with up to 4 places, allow repeats or force every number to be unique, and sort the output if you like. Click Calculate again for a fresh draw.

How to use the generator

  1. Enter the minimum and maximum. Both ends are included, so 1 to 10 can return 1 or 10.
  2. Set how many numbers you need, up to 10,000 per draw.
  3. Choose decimal places: 0 gives whole numbers, 2 gives values like 4.37.
  4. Pick duplicates: allow them for independent draws such as dice rolls, block them for raffles, lotteries and sampling without replacement.
  5. Optionally sort the results ascending or descending.

How the numbers are generated

The range is turned into a list of possible values: for whole numbers from 1 to 100 that is 100 values, for 0 to 1 with 2 decimals it is 101 values (0.00, 0.01 … 1.00). Each draw picks one of them with equal probability:

possible values  N = (max − min) × 10^decimals + 1
one draw         value = min + floor(random × N) ÷ 10^decimals
chance of a given value = 1 ÷ N

For unique numbers the generator either redraws on a repeat or shuffles the whole range with the Fisher–Yates algorithm and takes the first values, so every possible set is equally likely.

The randomness comes from your browser’s built-in Math.random(), a fast pseudo-random generator that is more than good enough for games, classroom picks, sampling and simulations. It is not designed for cryptography: do not use it to create passwords, encryption keys or for regulated lotteries.

Advertisement
Advertisement

Example draws

  • Roll a die: min 1, max 6, 1 number. Each face has a 1 in 6 chance, 16.666667%.
  • Roll two dice: min 1, max 6, 2 numbers, duplicates allowed. Doubles come up about 1 time in 6.
  • Raffle winners: tickets 1 to 250, 3 numbers, no duplicates. Nobody can win twice.
  • Lottery-style pick: 1 to 69, 5 numbers, no duplicates, sorted ascending, like the white balls in Powerball.
  • Random decimal: 0 to 1 with 4 decimals gives values such as 0.7314, useful for quick probability simulations.
  • Shuffle a range: 1 to 30, 30 numbers, no duplicates gives a random order of all 30, handy for seating or presentation order.

Odds of common draws

Draw Possible outcomes Chance of one specific outcome
Coin flip (1–2) 2 50%
One die (1–6) 6 16.67%
Number 1–10 10 10%
Number 1–100 100 1%
Two dice, both sixes 36 2.78%
3 unique from 1–10, any order 120 sets 0.83%
5 unique from 1–69, any order 11,238,513 sets 0.0000089%

The number of unordered sets is the combination C(n, k) = n! ÷ (k!(n − k)!). For multi-event odds, use the probability calculator.

Duplicates and the birthday effect

With duplicates allowed, repeats show up sooner than most people expect. Draw just 12 numbers from 1 to 100 and the chance that at least two match is 49.7%; with 23 draws from 1 to 365 it is also just over 50%, the famous birthday problem. If a repeat would spoil your draw, switch duplicates off.

Random numbers in Excel and Google Sheets

Spreadsheets have the same tools built in. =RANDBETWEEN(1, 100) returns a whole number from 1 to 100, and =RAND() returns a decimal from 0 up to (but not including) 1. In Excel 365 and Google Sheets, =RANDARRAY(5, 1, 1, 100, TRUE) fills five cells at once, duplicates possible. For a unique shuffle of 1 to 30, use =SORTBY(SEQUENCE(30), RANDARRAY(30)). Spreadsheet values recalculate every time the sheet changes, so paste them as values to keep a draw.

Good practice for fair draws

  • Number your entries first. Assign each person or item a number, then draw. To randomize a list of names directly, use the list randomizer.
  • Decide the rules before drawing. Fix the range, the count and whether repeats are allowed, then draw once, so nobody can suspect a re-roll.
  • Record the result. Take a screenshot or copy the numbers, because every click produces a new draw.

Frequently Asked Questions

Are the minimum and maximum included?

Yes. Both ends of the range can be drawn, so a range of 1 to 10 has 10 possible whole numbers.

How do I generate random numbers without repeats?

Set Duplicates to “No duplicates”. The generator then returns only unique values and warns you if you ask for more numbers than the range contains.

Is this random number generator truly random?

It uses the browser’s Math.random(), a pseudo-random algorithm that passes standard statistical tests and is fine for games, sampling and classroom use. It is not cryptographically secure.

Can I generate random decimals?

Yes. Choose 1 to 4 decimal places and the generator picks evenly from every value at that precision, for example 0.00 to 1.00 in steps of 0.01.

How do I pick a random winner for a giveaway?

Number the entries from 1 to the total, set that as the range, choose how many winners you need and select no duplicates. Save the result before clicking again.

Advertisement
Advertisement
Related

You may also need

All Math Calculators
Advertisement