Home › Text & Utility › Random Number Generator
Text & Utility

Random Number Generator

Whole numbers drawn fairly in any range you set — with or without repeats — using your browser's cryptographic random source, the same source the password generator on this site uses. The page also counts how many different sets your settings could produce, which is the number that decides how surprising any draw really is.

Free · No sign-up · Runs in your browser · First published 2026-10-19 · Updated October 2026

Draws use crypto.getRandomValues with rejection sampling, so every number in the range is exactly as likely as every other — no number is favoured by the arithmetic. Draw again for a fresh set; nothing is sent or stored.

Your numbers
—

A fair draw, and the count that tells you how fair

Teachers picking a student, families settling who washes up, players choosing lottery numbers — they all need the same thing: a number nobody chose and nobody could predict. This generator draws whole numbers in any range from crypto.getRandomValues, your browser's cryptographic random source, using rejection sampling so every number in the range is exactly as likely as every other. It can insist every number is different (a lottery-style draw), allow repeats (dice-style draws), and sort the result. Like the password generator, it works entirely on your device: nothing is sent anywhere, and the page works offline once loaded.

How many sets could there have been? The formula

Range size = largest − smallest + 1
Different sets (no repeats) = C(range, drawn) = range! ÷ (drawn! × (range − drawn)!)
Different sequences (repeats allowed) = range ^ drawn · Expected average of a draw = (smallest + largest) ÷ 2
Bar chart of how many different sets of 3 numbers can be drawn: 120 sets from numbers 1 to 10, 1,140 from 1 to 20, 4,060 from 1 to 30 and 18,424 from 1 to 49
From the table below, drawn as bars: widening the range multiplies the possible sets fast.

Every term is plain counting. The +1 in the range size is the step people drop: 1 to 100 holds 100 numbers, not 99, because both ends count. With no repeats, what matters is the set — the order the balls roll out does not make a new lottery ticket — so the count is the combination formula: choose which numbers appear, ignoring order. With repeats allowed, every position is an independent choice from the full range, so the counts multiply: range × range × … once per number drawn. And because each value is equally likely, a long run of draws settles around the range's middle — for 1 to 100, an expected average of 50.5 — which the table beside your draw shows so a single small draw is never mistaken for proof of bias.

Worked example: the default draw, 6 different numbers from 1 to 100

The defaults above draw 6 numbers, all different, from 1 to 100. The range size is 100 − 1 + 1 = 100. The number of different sets those settings could produce is C(100, 6) = 100! ÷ (6! × 94!) = 1,192,052,400 — over a billion possible sets, of which yours is exactly one. Two checks pin that figure down. Order would multiply it: the same 6 numbers can arrive in 6! = 720 orders, and 1,192,052,400 × 720 = 858,277,728,000 ordered outcomes — the count you would use if order mattered. And the scale is believable next to the famous case below: a smaller range or fewer picks shrinks the count fast. What your six numbers happen to be cannot be shown here — they are drawn fresh on your device, and two visits never agree. What can be checked is everything around them: the table beside the draw must report a range of 100 and 1,192,052,400 possible sets, and if it ever does not, the formula above is the authority and the page is wrong.

The counts behind familiar draws

DrawRangePickedDifferent sets / sequences
Default: numbers from 1 to 100 (worked example)1006, no repeats1,192,052,400 sets
National-lottery style: 6 from 1 to 49496, no repeats13,983,816 sets
3 from 1 to 49493, no repeats18,424 sets
3 from 1 to 30303, no repeats4,060 sets
3 from 1 to 20203, no repeats1,140 sets
3 from 1 to 10103, no repeats120 sets
Three dice-style draws, 1 to 10, repeats allowed103, repeats1,000 sequences (10 × 10 × 10)
One die616 outcomes

The lottery row is the one to sit with: 13,983,816 possible sets is why a jackpot ticket's chance is quoted as about 1 in 14 million — and why no pattern in past draws changes the next draw's count by a single set. The chart near the top draws the pick-3 rows as bars: widening the range from 10 to 49 multiplies the possible sets more than 150-fold, from 120 to 18,424.

Reading a draw honestly — the limits

Three cautions belong on any page that hands out randomness. A small draw proves nothing: six numbers averaging 71 do not mean the generator favours high numbers — the expected average of 50.5 is a long-run statement, and small samples swing widely by design. Random does not mean evenly spread: a fair draw can repeat a number in repeats mode, produce three low numbers in a row, or hand you 1, 2, 3 as a set; each of those had exactly the same chance as any less eye-catching outcome. Stakes change the tool you need: for classroom picks, raffles among friends and game nights this page is the right instrument. For a draw with money, prizes or legal weight, use a witnessed, audited drawing process instead — not because this arithmetic is weaker, but because you would need to prove afterwards how the draw was made, and a private browser page keeps no record by design.

Frequently asked questions

Is this random number generator really random?

It draws from crypto.getRandomValues, the cryptographic random source built into your browser — the same source used to secure connections — and applies rejection sampling so no value in the range is favoured by the arithmetic. That is a stronger source than the ordinary Math.random many simple sites use, which is predictable in principle. Each number is drawn fresh, independently, on your own device.

How many combinations are there in a 6-from-49 lottery draw?

13,983,816. The count is C(49, 6) = 49! divided by (6! × 43!), choosing which six numbers appear and ignoring the order they are drawn in. It is also the honest form of the jackpot odds: one specific set in about 14 million equally likely sets.

Why can I not draw more different numbers than the range holds?

Because 'different' runs out. A range of 1 to 10 holds only 10 numbers, so an eleventh different number does not exist — the generator says so rather than looping forever or quietly repeating one. Allow repeats, or widen the range, and the draw goes through.

Does sorting the numbers change the draw?

No — sorting only changes how the drawn numbers are displayed, smallest first, the way a lottery ticket is printed. The set itself, and the count of sets it could have been, are identical sorted or not. Unsorted shows you the order the numbers actually arrived in.

Can the generator favour certain numbers?

No, and the mechanism is the reason: random values that would bias the draw are discarded and redrawn (rejection sampling), so every number in the range has exactly the same probability on every draw. A run of high or low numbers is ordinary luck in a small sample — the expected average, shown beside your draw, only emerges over many draws.

Ahsan ul Haq
Editor, ToolFigure

Every ToolFigure calculator is checked against hand-worked examples before it is published — the same worked examples you can follow on each page. More about ToolFigure →

Related tools

Calculators that show their working

Free forever · No sign-up · Every result comes with its formula and a worked example.

Browse all tools