Random Number Generator

Set a minimum and maximum, then press Generate to get a random whole number in that range. Every number has exactly the same chance. You can draw up to 50 numbers at once, block repeats and sort the results.

Range 1 to 100 · 100 possible numbers Press Space to generate
42

How to use the random number generator

  1. Choose a range. Tap a quick range such as 1-10 or 1-100, or type your own Min and Max. Negative numbers work too.
  2. Pick how many numbers you need. Leave it at 1 for a single number, or enter up to 50.
  3. Decide on repeats. Keep "No repeats" ticked if each number can only come up once, like drawing tickets from a hat.
  4. Generate. Press the button or the Space bar. Your last results stay listed under the numbers, and Copy puts the full set on your clipboard.

Your chance of getting a specific number

With one draw, the chance of any particular number is 1 divided by the size of the range. Here are the ranges people use most.

RangePossible numbersChance per numberAs a percentage
1 to 661 in 616.67%
0 to 9101 in 1010%
1 to 10101 in 1010%
1 to 50501 in 502%
1 to 1001001 in 1001%
1 to 10001,0001 in 1,0000.1%

A range includes both ends, so 1 to 100 contains 100 numbers and 0 to 9 contains 10.

Who uses a random number generator

Anyone who needs a choice that nobody can influence. These are the people who use it most, and how.

  • Teachers

    Match numbers to the class register to call on students fairly, pick groups, or create quick maths drills. Projected on a screen, the result is visible to everyone, so no one feels singled out.

  • Event organisers and online sellers

    Number your raffle tickets or giveaway entries, then draw winners with No repeats on so nobody wins twice. A screenshot of the result makes a simple record for your announcement.

  • Researchers, auditors and QA teams

    Pick random records to check instead of the first few in a list, which can hide problems. Random selection is a basic step in sampling for surveys, stock counts and quality checks.

  • Game hosts and players

    Replace a lost die, decide turn order, run a guess-the-number round, or pick a random level or challenge in a video game.

  • Developers and testers

    Generate quick test values, IDs or ports without writing a script. Copy a set of numbers straight into a test file or spreadsheet.

  • Anyone stuck on a choice

    Number the options, from restaurants to chores, and let the generator decide. It settles a debate faster than a vote.

Worked examples

Real settings for common jobs. Press "Load this example" to fill in the generator and run it.

Draw 3 raffle winners from 250 tickets

Tickets are numbered 1 to 250, and a ticket can only win once.

Min 1 · Max 250 · How many 3 · No repeats on

Pick 5 students from a class of 32

Use each student's register number. Sorting makes the list easy to read out.

Min 1 · Max 32 · How many 5 · No repeats on · Sort on

Sample 20 rows from a spreadsheet

Your data runs from row 2 to row 1,201 because row 1 is the header. Sort the result so you can work down the sheet in order.

Min 2 · Max 1201 · How many 20 · No repeats on · Sort on

Roll two dice without dice

Two separate 1-6 numbers. Repeats must be allowed, because both dice can land on the same face.

Min 1 · Max 6 · How many 2 · No repeats off

Tips for getting the result you need

Repeats or no repeats? Turn repeats off when you're choosing between people or tickets, because each one should only be picked once. Leave repeats on when every draw is a separate event, such as dice rolls or daily random numbers.

Both ends count. A range of 1 to 10 includes 1 and 10, so it has ten possible numbers. If you number entries from 0, set Min to 0.

Need a decimal? The generator gives whole numbers. For two decimal places between 0 and 10, generate between 0 and 1000 and divide the result by 100.

Running a public draw? Share your screen or record it, and state the range and number of winners before you press Generate. People trust a draw they watched.

Why these numbers are fair

Each number starts as a 32-bit value from crypto.getRandomValues, the random source browsers use to create encryption keys. It can't be predicted from earlier results.

Fitting that value into your range with a simple remainder would make low numbers slightly more common. The generator throws away the few values that cause this and draws again, a method called rejection sampling. The result is an exactly even chance for every number in your range.

All of this happens on your device. Your ranges and results are never sent anywhere.

Random number generator questions

How do I generate a random number between 1 and 10?

Set Min to 1 and Max to 10, then press Generate. Each click, or each press of the Space bar, gives a fresh number with every value from 1 to 10 equally likely.

Can I generate several random numbers at once?

Yes. Change "How many" to the amount you need, up to 50. Tick "No repeats" if every number in the set must be different.

What does "No repeats" do?

It draws numbers without replacement, like pulling tickets out of a hat. Once a number appears in a set, it can't appear again in that same set.

Can I include negative numbers?

Yes. Any whole number works for Min and Max, so a range like -50 to 50 is fine.

Is this better than Math.random()?

For fairness, yes. Math.random() is fast but not designed to be unpredictable. This tool uses crypto.getRandomValues and rejection sampling, so each number in your range has an exactly equal chance.

Can I sort the results?

Yes. Use the sort toggle to show a set in ascending order, which is handy for lottery-style picks or seating orders.

Why did I get the same number twice in a row?

That's normal randomness. With a 1 to 10 range, the same number comes up back to back about one time in ten. Streaks feel suspicious to people, but a fair generator produces them.

Can I copy the results?

Yes. The Copy button puts the whole set on your clipboard as a comma-separated list, ready to paste into a spreadsheet or chat.

What's the largest range I can use?

Min and Max can go up to about nine quadrillion in either direction, which covers any practical use.