Skip to content
All calculators

Random Number Generator

Generate random numbers within a custom range, with optional uniqueness.

Inputs

Results

Set your range above and press Generate to draw random numbers.

What is the Random Number Generator?

A random number generator is a free online tool that produces one or more random integers inside a custom range. Use it for raffles, classrooms, dice-style games, sampling, and 'pick a number' decisions — with an optional 'no repeats' mode that guarantees every result is unique.

Random Number Generator formula

Each number is drawn with uniform probability using the browser's cryptographic random source (crypto.getRandomValues) and rejection sampling: a random 32-bit integer is rolled, and any value that would bias the modulo result is discarded and re-rolled. For 'no repeats' mode, a Fisher–Yates shuffle of the full range (small spans) or a Set-based draw (large spans) guarantees distinct results with no repeats.

How to use the Random Number calculator

  1. 1Enter the minimum and maximum values that bound the range (both inclusive).
  2. 2Set how many numbers you want to generate.
  3. 3Toggle 'No repeats' if every number must be unique — the count cannot exceed the range size.
  4. 4Optionally choose to sort the results ascending or descending.
  5. 5Click Generate to draw a fresh batch; each click produces a new independent set.

Example calculation

Generate 5 unique random numbers between 1 and 100. Set Min = 1, Max = 100, Count = 5, toggle 'No repeats' on, and click Generate. A typical result is [17, 42, 63, 84, 91] — five distinct integers, each uniformly distributed in [1, 100] with no repeats.

Frequently asked questions

Can the random number generator avoid repeats?
Yes — turn on 'No repeats' before generating. The calculator then draws without replacement so every number in the batch is unique. If you ask for more unique numbers than the range can hold (e.g., 10 unique numbers from 1–5), it shows a clear error explaining the range is too small.
How do I generate a random number between 1 and 100?
Set Min = 1, Max = 100, and Count = 1, then click Generate. Each click returns a fresh integer in [1, 100] inclusive. For a 'random number generator 1-100' with multiple draws, set Count to however many you need.
Is the generator truly random?
It uses the browser's cryptographic random source (window.crypto.getRandomValues with a Uint32Array) combined with rejection sampling. That makes the output uniformly distributed and unpredictable — suitable for raffles, sampling, and decisions. (For cryptographic secrets like passwords, use a dedicated password generator.)
What's the largest range I can use?
The range (max − min + 1) can be as large as 2^32 (about 4.3 billion). For non-unique draws there is no practical cap; for unique draws, large ranges use a Set-based algorithm so memory stays proportional to the count you request, not the range size.
Why can't I generate 10 unique numbers from a range of 1 to 5?
A range of 1–5 only contains 5 distinct integers, so it's impossible to draw 10 unique values. The calculator detects this and shows 'Cannot generate 10 unique numbers from a range of only 5 values (1–5)' instead of returning duplicates.

People also search for

  • random number generator no repeats
  • random number generator 1-100
  • random number picker
  • random number 1-10
  • random number 1-1000
  • lottery number generator
  • raffle number generator
  • random sample generator