Random Number Generator

Set a lower and an upper limit and press Generate to get a fair random number. Ask for many at once, choose whole numbers or decimals, switch off repeats for lucky draws, or use the quick picks for a dice roll or a coin toss.

How it is calculated

Enter the lower and upper limits. Both can be drawn.

Choose how many numbers you want and whether they are whole numbers or decimals.

Tick No repeats for raffles, team picks and lottery-style draws.

Press Generate. Press it again for a fresh draw.

Formula

Range: Every value from the lower limit to the upper limit, both included

Chance of each value: 1 ÷ (upper − lower + 1) for whole numbers

No repeats: Each value can be drawn at most once

Worked example

A teacher wants to pick 3 different students from a class of 40 by roll number.

Lower limit: 1

Upper limit: 40

How many: 3, no repeats

There are 40 − 1 + 1 = 40 possible roll numbers.

The first pick has a 1 in 40 chance for every student.

With No repeats on, a student already picked cannot be picked again.

Answer: Three different roll numbers between 1 and 40, such as 7, 22 and 35. Your draw will differ each time.

What is the Random Number Generator?

A random number generator picks numbers so that no value in the chosen range is favoured over any other and the next result cannot be predicted from the last. This one draws whole numbers or decimals between a lower and an upper limit, both of which can come up. You can ask for one number or thousands, sort them, and switch off repeats.

It is useful whenever a fair, unbiased choice is needed: picking a raffle winner, choosing students for an activity, deciding who goes first, sampling records for a survey or an audit, or creating practice data. Quick picks cover the common cases, such as rolling a dice, tossing a coin or drawing six numbers from 49. The numbers are produced on your own device by the browser's secure random source and are not sent anywhere.

How to calculate it by hand

1. Decide the range: the smallest and largest values that are allowed.

2. Count the possible values. For whole numbers this is upper − lower + 1.

3. Decide whether a value may come up more than once.

4. Enter the limits and how many numbers you need, then press Generate.

5. For a draw without repeats, make sure you ask for no more numbers than there are values.

6. Copy or note the result, since the next press gives a new draw.

What fair means

A draw is fair, or uniform, when every allowed value has the same chance. For whole numbers from 1 to 6 each has a chance of one in six. Results are also independent: a 6 on the last roll does not make a 6 less likely on the next. In a short run the results will look uneven, with repeats and gaps, and that is normal. Only over many draws do the counts even out.

With and without repeats

Drawing with repeats is like rolling a dice: the same number can come up again. Drawing without repeats is like pulling numbered tokens from a bag and not putting them back, which is how lotteries and raffles work. Without repeats, you cannot draw more numbers than exist in the range. With repeats, duplicates become likely sooner than most people expect: among 23 random birthdays there is about an even chance that two match.

How computers produce random numbers

A computer follows fixed instructions, so it gathers unpredictability from physical sources such as timing variations in hardware, and uses that to drive a cryptographic generator. This is far harder to predict than the simple generators used in older software. To keep the draw fair, this tool also throws away any raw value that falls outside the range and draws again, which avoids the slight bias that a simple remainder method would cause.

Worked example, step by step

A housing society has 250 raffle tickets numbered 1 to 250 and wants to draw 5 different winning tickets.

Lower limit: 1

Upper limit: 250

How many numbers: 5

No repeats: On

Possible values: 250 − 1 + 1 = 250 tickets.

Each ticket has the same 1 in 250 chance of being the first one drawn.

With No repeats on, a drawn ticket is removed, so the second pick is 1 in 249, and so on.

The chance that a particular ticket is among the 5 winners is 5 ÷ 250 = 2%.

Answer: Five different ticket numbers between 1 and 250. Every ticket has a 2% chance of winning; the actual numbers differ on every draw.

Common mistakes to avoid

Assuming the upper limit is left out. Both limits can be drawn.

Asking for more numbers without repeats than the range contains.

Believing a number is due because it has not come up for a while. Each draw is independent.

Re-drawing until a preferred result appears, which makes the choice no longer random.

Using an ordinary random generator for passwords or security keys without a tool designed for that purpose.

Where it is used

Raffles, lucky draws and giveaways.

Picking students, teams or the order of turns in class and at games.

Choosing a random sample of records for a survey, quality check or audit.

Dice rolls and coin tosses when none are at hand.

Generating practice numbers for maths drills and test data.

Frequently asked questions

Are the numbers really random?

They come from your browser's cryptographic random generator, which is unpredictable for all everyday purposes. Every value in your range has the same chance.

Are both limits included?

Yes. With limits 1 and 6, any of 1, 2, 3, 4, 5 or 6 can come up.

How do I run a lucky draw without repeats?

Number the entries, set the limits to the first and last entry number, enter how many winners you need and tick No repeats.

Can it generate very large numbers or long decimals?

Yes. Limits can be hundreds of digits long, and decimals can have up to 999 places.

Can I get the same result again?

No. Each press is a new, independent draw, so copy the result if you need to keep it.