🎲 Random Number Generator

Pick random numbers in any range: one or thousands at once, with or without repeats, sorted or in draw order. Uses your browser’s cryptographic randomness.

✓ Free✓ No Signup Required✓ Browser-Based

Set a range and press Generate.

What Random Number Generator Does

This random number generator draws whole numbers or decimals from any range you set — one at a time or up to 10,000 in a single click — with or without repeats. Every value comes from crypto.getRandomValues, the cryptographically secure generator that browsers provide for things like encryption keys, rather than the faster but predictable Math.random.

The part most generators get subtly wrong is turning raw random bits into a number in your range. The shortcut, taking the remainder after division, makes some results more likely than others whenever the range does not divide the raw range evenly. This tool uses rejection sampling instead: raw values that would cause that imbalance are thrown away and drawn again, so every number in the range has exactly the same chance.

With No repeats ticked, numbers are drawn without replacement, the way slips come out of a hat. For a draw that covers most of a range, the tool shuffles the whole range with a Fisher–Yates shuffle and takes the first values; for a few numbers from a huge range, it draws until it has enough distinct ones. Both are exact.

How to Use Random Number Generator

  1. Enter a minimum and maximum, or tap a preset range
  2. Choose how many numbers you want and how many decimal places
  3. Tick No repeats if each number may appear only once
  4. Pick a sort order and press Generate
  5. Copy the result or generate again — recent results are listed below

Formula Used by Random Number Generator

Why the remainder shortcut is biased (modulo bias)

value = (random byte mod 100) + 1 ← uneven when 256 is not a multiple of 100

random byte
An integer from 0 to 255 — 256 equally likely values
mod 100
The remainder after dividing by 100, giving 0–99

Worked example

Mapping one random byte to a number from 1 to 100 with the remainder.

  1. 256 = 2 × 100 + 56, so remainders 0–55 can each be reached three ways (e.g. 5, 105, 205)
  2. Remainders 56–99 can only be reached two ways (e.g. 60, 160)
  3. So 1–56 each come up with probability 3/256; 57–100 each with 2/256

Result: Numbers 1–56 are 50% more likely than 57–100. Rejection sampling discards bytes 200–255 and redraws, leaving exactly 2/200 for every value.

Chance of at least one repeat when repeats are allowed

P(repeat) = 1 − (n × (n−1) × … × (n−k+1)) ÷ nᵏ

n
How many different values the range contains
k
How many numbers you draw

Worked example

Drawing k = 10 numbers from 1–100 with repeats allowed.

  1. Probability all ten differ = (100 × 99 × … × 91) ÷ 100¹⁰ ≈ 0.628
  2. Probability of at least one repeat = 1 − 0.628

Result: About a 37% chance of a duplicate — which is why “No repeats” exists.

How Soon Repeats Appear

Chance that a list drawn with repeats allowed contains at least one duplicate. Calculated with the formula above.

RangeNumbers drawnChance of a repeat
1–6344.4%
1–10449.6%
1–1001037.2%
1–1001249.7%
1–3652350.7%
1–1,0003850.9%

How to Read Your Result

Streaks and clusters are normal

Random output often looks less random than people expect: the same number twice in a row, three low numbers together, a long gap before a value appears. Evenly spread results over a short run would actually be suspicious. Judge randomness over hundreds of draws, not a handful.

Pseudo-random is not a weakness here

Browsers generate these values with a cryptographic pseudo-random generator seeded from operating-system entropy — the same design approach NIST describes for deterministic random bit generators. For classroom picks, sampling, games and simulations it is indistinguishable from physical randomness and cannot be predicted from earlier output.

Limitations & Accuracy Notes

  • Results are not saved anywhere; if you need an auditable public draw, record the result yourself or use a service that publishes signed results.
  • Decimal mode draws from a grid (for example 0.00, 0.01 … 1.00 at two places), not from every real number in the range.
  • Ranges wider than 2⁵³ values cannot be sampled exactly with standard JavaScript numbers and are refused rather than approximated.
  • Up to 10,000 numbers per click; very large no-repeat draws over huge ranges take longer because each value must be checked for duplicates.

Frequently Asked Questions

How random are these numbers?
They come from crypto.getRandomValues, the cryptographically secure generator built into every modern browser — the same source used for encryption keys. Each value in your range is exactly equally likely because the tool discards the few raw values that would otherwise make low numbers slightly more common.
How do I generate numbers with no repeats?
Leave “No repeats” ticked. Each number in the range can then appear at most once, like drawing numbered slips from a hat without putting them back. If you ask for more unique numbers than the range contains — 20 unique numbers between 1 and 10, say — the tool tells you it is impossible instead of silently repeating.
Why did I get the same number twice in a row?
Because true randomness has no memory. With repeats allowed, each draw from 1–10 has a 1 in 10 chance of matching the previous one. Repeats also turn up in lists sooner than intuition expects: ten numbers drawn from 1–100 contain at least one duplicate about 37% of the time.
Can it generate decimal numbers?
Yes. Set Decimal places to 1–6 and every value on that grid between your minimum and maximum becomes equally likely. For example, 0 to 1 with 2 decimal places draws from the 101 values 0.00, 0.01 … 1.00.
Is this a true random number generator?
Strictly, no web page is: browsers run a cryptographic pseudo-random generator seeded from hardware and operating-system entropy. For picking numbers, shuffling and classroom or game use, its output is indistinguishable from true randomness and cannot be predicted from earlier results.
How many numbers can I generate at once?
Up to 10,000 per click. Results can be sorted low to high or high to low, padded with leading zeros (so 7 shows as 007 in a 0–999 range), and copied in one go.
How do I pick a random number between 1 and 100?
Tap the 1–100 preset (or type 1 and 100), keep How many at 1 and press Generate. The same works for 1–10, 1–1,000 or any custom range, including negative numbers.

References & Further Reading

By OnlineToolHubs Team • Updated September 2026