Free Random Number Generator

Generate random numbers within a range you set. Choose how many to draw, whether to allow duplicates, and whether to sort the results.

Quick answer

A random number generator produces numbers within a range you choose. Set a minimum and maximum, pick how many you want, and decide whether repeats are allowed. This tool draws uniform, unbiased numbers using your browser’s secure random generator.

Formula & method

Numbers are drawn uniformly from your inclusive min–max range using the browser’s Web Crypto API with rejection sampling, which avoids the slight bias a plain modulo would introduce. With duplicates turned off, drawn numbers are removed from the pool so each result is unique (a random selection without replacement).

Examples

Example 1: One number, 1–100
Input
min 1, max 100, count 1
Result
e.g. 57
Why
A single uniform draw from the inclusive range.
Example 2: Lottery-style, no repeats
Input
min 1, max 49, count 6, unique
Result
e.g. 4, 11, 23, 28, 35, 42
Why
Six distinct numbers, like a 6/49 draw.
Example 3: Dice substitute
Input
min 1, max 6, count 1
Result
A number from 1 to 6
Why
Any small range works as a roll.

When to use this tool

  • Picking a winner, a seat, or an order at random.
  • Drawing several unique numbers without replacement.
  • Generating sample data or a quick random pick.

Common mistakes

  • Requesting more unique numbers than the range allows (e.g. 10 unique values from 1–5).
  • Forgetting the range is inclusive of both the minimum and the maximum.
  • Assuming this is suitable for lotteries or gambling — it’s for everyday, fair selection.

Frequently asked questions

How do I generate a random number in a range?

Enter a minimum and maximum, set how many numbers you want, and generate. Results are drawn uniformly from the inclusive range you chose.

Can I avoid duplicate numbers?

Yes. Turn off duplicates to draw unique numbers without replacement — useful for raffles or lottery-style picks.

Are the numbers truly random?

They use the Web Crypto API, a cryptographically secure source, with rejection sampling to keep every value equally likely.

Is the range inclusive?

Yes. Both the minimum and the maximum can be produced.

Does it improve my odds in a lottery?

No. Random numbers can’t predict or improve lottery outcomes. This tool is for everyday fair selection, not gambling.

What's rejection sampling and why do you use it?

Rejection sampling ensures every number in your range is equally likely. A naive modulo approach slightly favors lower numbers; rejection sampling avoids that bias by discarding values outside an aligned multiple of your range.

Can I generate negative numbers?

Yes—set the minimum to any negative number (e.g., –50) and the maximum to any positive number (e.g., 50). The range works exactly the same.

  • ✓ Free to use
  • ✓ No sign-up required
  • Runs entirely in your browser — nothing is uploaded.
  • ✓ Formula and method shown above

Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.

Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.

Related tools

Embed this tool on your site

Free to embed, no sign-up. Paste this code where you want the random number generator to appear: