Random Number Generator

How to use 3 steps
  1. Set the Minimum, Maximum and How many numbers.
  2. Tick No duplicates or Sort results if needed.
  3. Press Generate, then Copy.
Your numbers

Numbers come from your browser's cryptographic random source, not Math.random, and are drawn without modulo bias — every value in the range is equally likely.

How this tool works

Generates random numbers in any range you specify, one at a time or up to a thousand at once, optionally without duplicates and optionally sorted.

Numbers come from the browser's cryptographic random source rather than from the ordinary pseudo-random function, and rejection sampling is used to draw them into range. That second part matters more than it sounds: taking a random number modulo a range makes the lowest values slightly more likely whenever the range does not divide evenly, and rejection sampling avoids that bias by discarding draws that fall in the uneven remainder. The result is a uniform distribution rather than an almost-uniform one, which is what makes the output fit for a draw or a ballot.

What makes a draw fair

  • Modulo bias is subtle and real: the naive approach skews towards lower numbers. Rejection sampling costs a few discarded draws and removes the skew entirely.
  • Without duplicates the range must be large enough: asking for fifty unique numbers from a range of twenty has no answer, and the tool says so rather than looping forever.
  • Sorting is display only: the numbers are drawn first and ordered afterwards, so sorting does not affect which came out.
  • Random does not mean evenly spread: genuine randomness produces clusters and gaps. A result that looks patternless to the eye has usually been tidied up.

Drawn from the browser's cryptographic source

The [msm_tool slug="random-number-generator"] draws from the browser's cryptographic random source rather than the ordinary pseudo-random function most code reaches for by default, which is seeded from operating system entropy and specifically designed to be unpredictable — a meaningfully stronger guarantee than an everyday random function offers, even if a physical process such as radioactive decay remains the only genuinely true randomness available anywhere.

Why modulo bias matters more than it sounds

Reducing a random draw into a target range with a simple remainder operation makes the lowest values in that range very slightly more likely to appear, whenever the range does not divide the underlying draw space evenly — a small, systematic skew rather than a random one. Rejection sampling avoids it entirely by discarding and redrawing whenever a value falls in the uneven remainder, at the cost of a few extra draws that never make it into the result.

Asking without duplicates has a hard limit

The range has to contain at least as many values as the number requested, and asking for fifty unique numbers from a range of only twenty simply has no valid answer — the tool reports that directly rather than looping indefinitely or quietly handing back fewer numbers than asked for.

Sorting changes how results look, not what was drawn

Numbers are drawn first and only ordered afterwards if sorting is requested, so turning sorting on or off has no effect whatsoever on which values were actually generated — it changes the presentation of the result, not its content.

Genuine randomness looks clumpy, not evenly spread

True randomness produces clusters and gaps rather than an even spread across the range, so a set of numbers that looks suspiciously tidy and patternless to the eye has usually been arranged that way rather than occurring naturally. A result that looks a little uneven is closer to what real randomness actually produces than one that looks perfectly balanced.

Fine for a raffle, not for a regulated draw

For an informal prize draw among friends or a casual raffle, this is entirely adequate. A formal or regulated draw typically needs an auditable process with a documented seed and a verifiable record behind it, which a browser-based tool with no logging simply does not provide.

Frequently Asked Questions

Specific to the Random Number Generator. Broader questions about this category are answered on the category page.

It uses the browser's cryptographic random source, which is seeded from operating system entropy and is designed to be unpredictable. That is far stronger than an ordinary pseudo-random function, though a physical process such as radioactive decay or atmospheric noise is the only true randomness available.
Reducing a random draw into range with a remainder operation makes the lowest values slightly more likely, whenever the range does not divide the draw space evenly. It is small but systematic, and it is avoided here by discarding and redrawing rather than folding the remainder in.
Yes. The range has to contain at least as many values as you request, and if it does not you will get an explanation rather than an incomplete list.
Up to a thousand per draw. Larger requests are capped rather than refused.
For an informal one, yes. A formal or regulated draw usually needs an auditable process with a documented seed and a verifiable record, which a browser tool does not provide.

Subscribe to receive notifications about new tools, features, and productivity tips.