πŸ”

Random Number Generator

Generate random numbers within a specified range

Last updated

How to Use This Tool

Set a minimum and maximum, choose how many numbers you want, then generate and copy the results.

When Should You Use This Tool?

Use this for games, quick random choices, picking winners, or generating simple test values.

Steps

  1. Set the range.
  2. Choose how many numbers to generate.
  3. Enable unique numbers if needed.
  4. Click β€œGenerate” and copy the result.

See also: Random Name Generator, Random Prompt .

How do I generate a random number between two numbers?

Type the lowest number you want in Minimum, the highest in Maximum, and click Generate. Both ends are included, so a range of 1 to 100 can return 1, 100, or anything in between, and every whole number in the range has the same chance of coming up. The defaults are already set to 1 and 100, so for a quick "pick a number from 1 to 100" you only need to press the button.

To get several numbers at once, change How many numbers. Results appear as a comma separated list you can copy straight into a spreadsheet, chat, or document.

What does "unique numbers only" do?

It stops the same number from appearing twice in one batch. With the box ticked, the tool builds a pool of every number in your range and draws from it without putting numbers back, the same way you would pull tickets out of a hat. With the box unticked, each number is drawn independently, so repeats are possible and often more common than people expect.

For example, if you draw 10 numbers from 1 to 100 without the unique option, the chance that at least two of them match is about 37%. Draw 20 and it rises to about 87%. That is the same maths behind the well known birthday problem. If duplicates would be a problem, such as picking prize winners or assigning seats, turn on unique mode.

If you ask for more unique numbers than the range holds (for example 12 unique numbers between 1 and 10), the tool shows a message instead of a result. Widen the range or lower the count.

How do I pick a raffle or giveaway winner with random numbers?

Number every entry, then draw from that range. A simple method that anyone can check afterwards:

  1. Give each ticket or entrant a number, starting at 1. Keep the list, for example in a spreadsheet.
  2. Set Minimum to 1 and Maximum to the number of the last entry.
  3. Set How many numbers to the number of prizes and tick Unique numbers only, so one person cannot win twice.
  4. Click Generate once, ideally while sharing your screen or recording it, and match the numbers back to your list.

If you need backup winners in case someone does not respond, draw a few extra numbers in the same batch. The order they appear in is also random, so you can treat the first numbers as the main winners and the rest as alternates.

Common ways to use a random number generator

TaskSettingsUnique?
Pick a number from 1 to 10Min 1, Max 10, count 1Not needed
Pick 3 raffle winners from 250 ticketsMin 1, Max 250, count 3Yes
Roll a six sided dieMin 1, Max 6, count 1Not needed
Lottery style draw (6 numbers from 1 to 49)Min 1, Max 49, count 6Yes
Shuffle a running order for 8 presentersMin 1, Max 8, count 8Yes
Choose a random page of a 300 page bookMin 1, Max 300, count 1Not needed
Sample test values including negativesMin -50, Max 50, count 20Either

The shuffle trick in the table works because asking for as many unique numbers as the range holds gives you every number exactly once, in random order. It is a quick way to set a random order for speakers, turns in a game, or questions in a quiz.

What are the odds of each number?

Each number has a chance of 1 divided by the size of the range. The size of the range is Maximum minus Minimum plus 1, because both ends count.

  • 1 to 10: each number has a 1 in 10 chance (10%).
  • 1 to 100: each number has a 1 in 100 chance (1%).
  • -5 to 5: there are 11 possible numbers, so each has a 1 in 11 chance (about 9.1%).

For combined draws the odds shrink quickly. Matching all 6 numbers in a 6 from 49 draw, in any order, is 1 in 13,983,816. That is why lottery jackpots are rare, and it is a useful example when teaching probability.

Is this random number generator truly random?

It is statistically random but not cryptographically secure. The tool uses your browser's built in Math.random() function, which is a pseudo random number generator. It produces numbers that are evenly spread and unpredictable enough for games, classroom exercises, raffles among friends, sampling and test data. It is not designed for passwords, encryption keys, or regulated gambling, where you should use a generator built on a cryptographic source. Everything runs in your browser, so the numbers are never sent to a server.

Tips for getting the result you want

  • Whole numbers only: the tool returns integers. For a decimal such as 0.00 to 1.00, generate a number from 0 to 100 and divide by 100.
  • Negative ranges work: set a negative Minimum such as -20 to include values below zero.
  • Minimum must not be higher than Maximum: if it is, the tool asks you to fix the range instead of guessing.
  • Draw once for fairness: when a result decides something, agree on the settings first and accept the first draw, rather than generating until you like the answer.

Frequently Asked Questions

How random are the generated numbers?
The numbers come from JavaScript's Math.random() function, a pseudo random generator built into your browser. It gives an even spread of results that is fine for games, raffles, sampling and test data. For passwords, encryption or regulated gambling, use a cryptographically secure generator instead.
Are the minimum and maximum included in the results?
Yes. Both ends of the range are included. A range of 1 to 10 can return 1 and 10 as well as every whole number between them, each with an equal 10% chance.
Can I generate negative numbers?
Yes, simply set a negative minimum value. The tool works with any integer range, including ranges that are entirely below zero or that cross zero, such as -50 to 50.
How do I pick random numbers without repeats?
Tick "Unique numbers only" before you click Generate. The tool then draws from the range without replacement, so no number appears twice in the same batch. This is the setting to use for raffle winners, lottery style draws and shuffled running orders.
What happens if I request more unique numbers than the range allows?
The tool will alert you that it's impossible to generate that many unique numbers from the specified range. For example, 1 to 10 only holds 10 different numbers. Reduce the count or increase the range.
How do I shuffle a list of numbers into a random order?
Set the count equal to the size of the range and turn on unique mode. For example, Minimum 1, Maximum 8 and count 8 returns the numbers 1 to 8 each exactly once in a random order.
Can I generate decimal numbers?
The tool generates whole numbers only. To get decimals, generate integers over a larger range and divide. For example, a number from 0 to 1000 divided by 100 gives a value from 0.00 to 10.00.
Is there a limit to how many numbers I can generate?
The count box is set up for up to 100 numbers per batch. For larger batches, generate multiple sets and combine them, keeping in mind that separate batches can repeat numbers even with unique mode on.