InfyCalculator
🎲

Random Number Generator: Pick Random Numbers in Any Range

Generate random numbers in any range: whole numbers or decimals, one or up to 1,000 at a time, with or without repeats, numbers to exclude, sorted or in draw order, and an optional seed to repeat a draw. Good for raffles, giveaways, games and sampling.

Minimum
Maximum
How many
Repeats
Decimal places
Order
Numbers to exclude
Seed (optional)
Loading calculator…

How it works

number of possible values N = (max − min) × 10^decimals + 1 · each draw = min + floor(random × N) ÷ 10^decimals, so every value from min to max (both included) has a 1/N chance · unique mode draws without replacement (partial Fisher–Yates shuffle)

Every number is drawn with an equal chance across the whole range, minimum and maximum included. Without a seed the numbers come from your browser’s cryptographic random source (crypto.getRandomValues), which is unpredictable and evenly spread. Choose “Allow repeats” for independent draws, such as rolling a die many times, or “Unique numbers only” to draw without replacement, like pulling raffle tickets from a hat; if you ask for more unique numbers than the range holds, the count is trimmed to fit. Under More options you can draw decimals (for example two decimal places between 0 and 1), sort the result, exclude numbers that were already drawn or are not allowed, and set a seed. A seed makes the draw repeatable: the same seed and settings always produce the same numbers, which lets other people verify a giveaway result. The draw-order table keeps the original order even when you sort, so the first number drawn can go to first prize. Because the page recalculates whenever an input changes, editing any field produces a new set unless a seed is set.

Worked example

Five numbers between 1 and 100 with repeats allowed: there are 100 possible values, each with a 1 in 100 (1.00%) chance per draw, so a result such as 7, 43, 43, 88, 12 is possible. With repeats, the chance that all five are different is 100 × 99 × 98 × 97 × 96 ÷ 100⁵ = 90.3%, so about one draw in ten contains a repeat. Switch to unique and every number differs; each value then has a 5 ÷ 100 = 5% chance of being picked, and asking for 6 unique numbers between 1 and 5 is trimmed to 5.

Sources: MDN: Crypto.getRandomValues() · Wikipedia: Fisher–Yates shuffle

Frequently asked questions

How do I pick a random winner for a giveaway?

Number the entries from 1 to the total, set that range, choose “Unique numbers only” and ask for as many numbers as you have prizes. Use the draw-order table for 1st, 2nd and 3rd place, and set a seed if you want others to be able to repeat the draw.

Why did my numbers change when I edited a field?

The generator re-rolls whenever any input changes because it recalculates the whole result. Write down a set you want to keep, or set a seed under More options so the same settings always give the same numbers.

Is this truly random?

Without a seed it uses the browser’s cryptographic random generator, which is suitable for games, raffles and sampling. With a seed it uses a fast pseudo-random formula so results can be repeated; seeded draws are predictable by design and should not be used for passwords or security.

What does “unique numbers only” do?

It guarantees no value repeats in the set, like drawing numbered balls without putting them back. If you request more unique numbers than the range contains, the count is capped to the number of available values.

How do I generate a random decimal between 0 and 1?

Set the minimum to 0, the maximum to 1 and the decimal places under More options to the precision you want, for example 4 for numbers such as 0.3817.

Can I avoid numbers that were already drawn?

Yes. Paste them into “Numbers to exclude” under More options, separated by commas or spaces, and they will not be drawn again.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.