Qgenx Tools

Random Number Generator

Generate unbiased random integers or unique sequences with Web Crypto API (crypto.getRandomValues) directly in your browser.

Runs in your browser
42
First / draw
1
Generated
42
Mean
1–100
Range
Generated output

About this tool

A random number generator (RNG) produces uniformly distributed integers within an inclusive range using your browser's cryptographically secure pseudorandom number generator (crypto.getRandomValues). Unlike naive Math.floor(Math.random() * range), this tool uses 32-bit Web Crypto entropy with rejection sampling to eliminate modulo bias across any range.

How to use the random number generator

  1. Enter the minimum and the maximum. Both values are included in the range.
  2. Enter how many numbers you need in the count box.
  3. Tick Unique numbers if each number should appear only once.
  4. Choose the output order: random, ascending or descending.
  5. Press Generate to draw the numbers, and Copy to take them.

How random numbers are drawn

The generator picks whole numbers between the minimum and maximum, with each value in the range equally likely. The browser's own random number source is used, so the draw is fair and not predictable from one draw to the next.

Unique mode removes each number from the pool after it is drawn, which is how a raffle or a lottery works. Without it, the same number can come up more than once, as it would when rolling dice.

A worked example

To pick five different winners from 1 to 50, enter 1 as the minimum, 50 as the maximum, 5 as the count and tick Unique numbers. Each press of Generate gives a new set of five, with no repeats. Choosing ascending order makes the list easy to check against a register.

  • Pick a random seat order for a team of eight with unique numbers.
  • Draw a random sample of 20 customer IDs between 1 and 5000 for a quality check.

Who uses a random number generator

  • Teachers choosing students at random for questions.
  • Event organisers running a fair draw.
  • Game masters rolling values for a board game or a role-play session.
  • Researchers selecting random samples for surveys and tests.
  • Anyone who needs a quick fair choice.

Tips and limits

  • Unique numbers need a range at least as large as the count. Asking for 10 unique numbers from 1 to 5 cannot work.
  • A random draw is fair, but it is not a substitute for a documented selection method when a result must be audited.
  • Ascending and descending only change the order of the list, not which numbers are drawn.
  • Very large counts can take longer to display. Keep the count to what you need.
  • The draw happens in your browser, and the numbers are not stored or sent to us.

Frequently asked questions

Yes. Setting Min to 1 and Max to 10 can produce both 1 and 10 with equal probability.

Related browser tools