Math Calculators

Random Number Generator

Every draw takes whole numbers from an inclusive range, so both ends are possible, and each value is equally likely. Choose how many numbers you want, switch repeats off for a set of distinct numbers, and enter a seed to repeat exactly the same draw later.

Calculator

The range
Options

Leave the seed blank and the page generates one for this draw. The seed used is printed with the result, so entering it again repeats the same numbers.

The rules

  • Both ends of the range are included.
  • Every number in the range is equally likely at each position.
  • With repeats off, no number appears twice and the number of possible draws is C(n, k).
  • The list is printed in draw order unless you sort it, and sorting only orders the same numbers.

Repeats are off by default: a draw of six numbers from 1 to 49 gives six different numbers, which is what a lottery-style draw does.

Formula

Each number is drawn from the inclusive range [min, max], which holds n = max − min + 1 values, and every value is equally likely: the drawn value is min + ⌊u · n⌋ for a uniform u in [0, 1). With repeats off the draw is a uniform sample without replacement, so nothing appears twice and the number of possible lists is C(n, k) = n! / (k! · (n − k)!); for 1 to 49 with six numbers that is C(49, 6) = 13,983,816, and for 1 to 10 with three numbers it is C(10, 3) = 120. With repeats on each of the k draws is independent and the number of possible lists is nᵏ. The list is printed in draw order unless sorted, and sorting only orders the same numbers. The seed drives a 32-bit pseudo-random generator, so the same seed and the same settings always produce the same list.

About This Calculator

What It Does

This page draws whole numbers from a range you set. You choose the lowest and highest number — both included — how many numbers to draw, whether a number may appear more than once, and whether the list should be sorted. It prints the numbers in draw order, the seed the draw used, how many numbers the range holds, and, when repeats are off, how many different lists the range could produce. A draw of more distinct numbers than the range holds is refused, and the refusal names the count the range does hold.

Worked Example

The page opens on 1 to 49, six numbers, repeats off and the seed blank. Drawing with the seed 12345 gives 49, 16, 25, 41, 27, 21 in draw order, or 16, 21, 25, 27, 41, 49 sorted. Six distinct numbers can be chosen from 49 in C(49, 6) = 13,983,816 ways, and the page prints that figure beside the list. Enter 12345 again with the same settings and the same six numbers come back; change the seed and the draw changes.

Real-World Usage

Use it wherever a list of numbers has to be picked fairly and the picking has to be shown afterwards: teams for a draw, the order of a presentation, a sample of rows to check, ticket numbers for a raffle, or six numbers for a lottery ticket. Leave repeats off when no number may appear twice, as in a lottery or an assignment of places; switch them on for dice-like draws where a repeat is expected, such as rolling for a character or simulating a series of independent picks.

Local Context

The arithmetic is the same in every country and the page carries no country setting, so one page serves them all. Your language decides how the list is written, while the numbers themselves are the same everywhere. Nothing here is a certified lottery drawing: it is a reproducible pseudo-random draw from your own browser, and a real lottery's draw is run and published by its operator.

Sources and Methodology

The page's arithmetic is the sampling identity written into the calculator module rather than quoted from a source: the range holds n = max − min + 1 values, a draw without replacement has C(n, k) possible outcomes, and a draw with replacement has nᵏ. The generator is the published mulberry32 32-bit generator. The page states what it is: pseudo-random, reproducible by its seed, and neither a certified lottery drawing nor a cryptographic source.

Last reviewed: October 2026.

Frequently Asked Questions

Is this truly random?

It is pseudo-random: the numbers come from a seeded generator inside your browser, not from a physical source. That is what makes a draw repeatable — the same seed and settings always give the same numbers — and it also means the result is not a certified lottery drawing and must not be used as a cryptographic source.

Can I repeat a draw?

Yes. Every result prints the seed the draw used. Enter that seed with the same range, count and repeats setting and you get exactly the same numbers, in the same order, whatever device or language you use.

Why can't I draw 20 numbers from 1 to 10?

With repeats off, every number in the range may appear only once, so a range of 1 to 10 holds ten numbers and cannot supply twenty distinct ones. Widen the range, lower the count, or switch repeats on — with repeats on, any count up to 1,000 is accepted.

Does sorting change the draw?

No. Sorting only orders the numbers that were already drawn; it never changes which numbers they are. The seed reproduces the draw, and switching sorting on and off shows the same list arranged two ways.

How many possible draws are there?

With repeats off, C(n, k), where n is how many numbers the range holds and k is the count: 1 to 49 with six numbers has 13,983,816 possible draws. The page prints that figure beside the result, or a dash when repeats are on, because independent draws have no combination count.

Related Tools