Skip to content
SPCXTools

Random Number Generator

Pick random numbers in any range — one at a time or thousands, with no repeats if you need.

Runs locally — files never leave your device

Loading tool…

How to use Random Number Generator

  1. 1Enter the Minimum and Maximum values. Both ends of the range are included.
  2. 2Set How many numbers you want and, for decimals, the number of Decimal places.
  3. 3Keep No duplicates ticked to draw each number at most once, like a raffle or lottery.
  4. 4Click Generate. Tick Sort results to list the numbers in ascending order, then copy them.

Generate random numbers in any range

Need a number between 1 and 100, six lottery numbers, or a list of 1,000 random values for a test? This random number generator picks numbers in any range you choose, with options for no duplicates, sorting and decimal places. It uses your browser's cryptographically secure randomness, so results are unpredictable and evenly distributed, and nothing is sent to a server.

Features

  • Any range, including negative numbers and very large values.
  • One or many: generate up to 10,000 numbers in one click.
  • No duplicates mode that draws numbers like balls from a bag, efficiently even for huge ranges.
  • Decimal numbers with up to six decimal places.
  • Sort results in ascending order and copy them as a list.
  • Unbiased: rejection sampling ensures each value in the range is equally likely.

Popular uses

Games and decisions. Roll a virtual die (1–6), pick who goes first, choose a random page or question, or settle a decision fairly.

Raffles and giveaways. Assign each entry a number, then draw winners without duplicates. Because the randomness comes from a secure source, no one can predict or influence the result.

Lotteries. Generate a set of unique numbers for lottery tickets. Random choices avoid popular patterns like birthdays, which means you are less likely to share a prize.

Education and research. Select random samples from a numbered list, assign participants to groups, or create practice exercises.

Software testing. Generate test inputs, IDs or sample datasets in a specific range.

How "fair" random numbers are produced

A naive approach takes a large random value and uses the remainder after dividing by the size of the range. That subtly favours some numbers whenever the range does not divide evenly into the random source. This tool instead discards values that would cause bias and draws again ("rejection sampling"), so a range of 1–3 gives each number exactly a one-in-three chance.

For unique draws, the tool performs a partial Fisher–Yates shuffle: conceptually it shuffles the whole range and takes the first numbers, but without ever building the full list, so drawing 10 numbers from 1 to 1,000,000,000 is instant.

If you need random text instead of numbers, try the Password Generator or the UUID Generator.

Frequently asked questions

Are the numbers truly random?
They come from your browser's cryptographically secure random number generator (crypto.getRandomValues), which is seeded from unpredictable system sources. The tool also uses rejection sampling, so every number in the range is exactly equally likely — there is no bias towards small numbers.
Are the minimum and maximum included?
Yes. A range of 1 to 10 can return both 1 and 10. For decimals, results fall anywhere between the two values.
How do I pick lottery numbers?
Set the range used by your lottery (for example 1 to 49), set How many to the number of balls drawn (for example 6), keep No duplicates on, and tick Sort results. Remember that every combination has exactly the same chance of winning.
Why do I get an error with No duplicates?
You asked for more unique numbers than the range contains — for example, 20 unique numbers between 1 and 10. Increase the range or reduce the count, or allow duplicates.
Can I use it for a giveaway or raffle?
Yes. Number your entries, set the range to match, and draw as many winners as you need without duplicates. For transparency, you can record your screen while generating.
Is anything sent to a server?
No. Numbers are generated on your device.