Random Number Generator

Generate random numbers within any range, with options for unique values.

What is a Random Number Generator?

A random number generator (RNG) produces numbers that cannot be reasonably predicted by any pattern. Random numbers are used in games, simulations, cryptography, statistical sampling, lottery drawings, and many other applications where unpredictability is essential.

This tool uses the browser's crypto.getRandomValues() API, providing cryptographically secure randomness — far more random than the commonly used Math.random().

How to Use

  1. 1Set the Min and Max values for your range.
  2. 2Enter how many numbers you want to generate.
  3. 3Optionally check Unique numbers (no repeats) or Sort results.
  4. 4Click Generate and copy results to clipboard.

Formula

Random Integer in [min, max]:
  range = max − min + 1
  randomInt = min + floor(cryptoRandom × range)

Where cryptoRandom is a uniform value in [0, 1)
generated by crypto.getRandomValues().

For unique numbers:
  Use Fisher-Yates shuffle on the full range
  then take the first N values.

Frequently Asked Questions

This tool uses the browser's Web Crypto API (crypto.getRandomValues) for cryptographically secure randomness — more unpredictable than Math.random() which uses a pseudo-random algorithm.
Yes. Enable "Unique numbers", set the range to match your lottery (e.g., 1–49 for UK Lotto), and set count to the required picks (e.g., 6). The tool generates unique numbers just like a lottery draw.
Pseudo-random numbers use a deterministic algorithm — given the same seed, they produce the same sequence. Cryptographically random numbers use hardware entropy sources and are not reproducible, making them suitable for security applications.
Yes. Set the Min value to a negative number (e.g., -100) and Max to 100 to generate numbers in the range -100 to 100.