Skip to the game
Tic Tac Toe

Random Number Generator

This random number generator picks from any range you set: one number, or up to 500 at once with no repeats, ready to sort and copy.

Random number generator

Pick a range, then generate.

Each number from 1 to 100 has a 1 in 100 (1%) chance.

Press Enter in a box, tap the number or the button, or press Space, Enter, or G.

Recent numbers

  1. Your numbers will show up here.
Options
Your range and options are saved in this browser.
Quick ranges

How it works

How to use the random number generator

Type a range in From and To, choose 1 to 500 numbers, and press Generate; a set of several also shows its sum and average.

  1. Step 01

    Set the range

    Type the smallest and largest numbers in From and To, or tap a quick range such as 1 to 100. Both ends are included.
  2. Step 02

    Choose how many

    Use the plus and minus buttons, or type a count from 1 to 500. Leave No repeats on to make every number in a draw different.
  3. Step 03

    Generate

    Tap the number, press Generate, or press Space, Enter, or G. The numbers are decided at once, then shown. The copy button puts them on your clipboard.

Features

A random number generator that keeps the odds even

  • Fair numbers

    Draws come from a cryptographic random source, and for 1 to 100 the 96 uneven raw values are redrawn, so no number is favored.

  • Any whole-number range

    Negative numbers, huge numbers, and ranges of up to about 9 quadrillion values. If From is bigger than To, they're swapped.

  • Up to 500 at once, no repeats

    Draw a whole set in one go. With No repeats on, every number in the draw is different, like tickets pulled from a hat.

  • Quick ranges

    One tap for 1 to 10, 1 to 100, 1 to 1,000, a die from 1 to 6, or six lottery-style numbers from 1 to 49.

  • Sorted, summed, and averaged

    Show several numbers from smallest to largest, with their sum and average under the result.

  • Copy and recent numbers

    Copy the numbers as a comma-separated list, and look back at your last 20 draws and their ranges.

Tips

Random number generator tips for raffles, lotteries, and spreadsheets

A few ways to get the most out of the generator, and what to expect from truly random numbers.

  • Run a raffle

    Set From and To to the first and last ticket numbers, keep No repeats on, and set the count to the number of prizes. The first number drawn wins first prize.

  • Turn No repeats off for independent draws

    When each number should be its own draw, like rolling a die several times, switch No repeats off. Then the same number can come up again.

  • Expect repeats sooner than you think

    Draw 13 numbers from 1 to 100 with repeats allowed and there's a 55.7% chance that at least two match. With 10 draws it's 37.2%.

  • No lottery set is luckier

    The 6 of 49 range draws six different numbers and sorts them. All 13,983,816 possible sets are equally likely, so 1-2-3-4-5-6 is as likely as any other.

  • Paste straight into a spreadsheet

    Copy gives plain digits separated by commas, with no thousands separators, so the numbers drop neatly into a sheet or a message.

About the tool

Random number generator: fair whole numbers in any range, with or without repeats

How the generator works, ranges and limits, no repeats, lottery draws, the math of repeats, controls, and where random numbers came from.

A random number generator picks a whole number from a range you choose, with every number in that range equally likely. Use it to pick a number from 1 to 10, draw up to 500 different numbers for a raffle, or make a set of lottery-style numbers.

How to use the random number generator

Type the lowest number you want in From and the highest in To. Both ends count, so 1 to 10 can give 1, 10, or anything in between. The line under the result tells you the chance of each number, such as 1 in 100 (1%) for the range 1 to 100.

Next, choose how many numbers you want, from 1 to 500, with the plus and minus buttons or by typing the amount. Then press Generate, tap the big number, or press Enter in one of the boxes. A single number rolls through a few values for a moment before it lands. Several numbers appear one after another.

Ranges and limits: negative, huge, and swapped numbers

Any whole numbers work, including negative ones, from −9,007,199,254,740,991 up to 9,007,199,254,740,991. That's the largest whole number a browser can store exactly. A single range can hold up to 9,007,199,254,740,992 numbers, about 9 quadrillion, so 0 to 9,007,199,254,740,991 works, but the full span from the most negative number to the most positive is too wide.

You don't need to be tidy when you type. Spaces, commas, and underscores are ignored, so 1,000,000 and 1 000 000 both work. Decimals aren't accepted, because the generator only picks whole numbers. If From is bigger than To, the two are swapped for you and the result says so.

No repeats, or repeats allowed

With No repeats on, every number in one draw is different, as if each one were taken out of a hat and kept out. That suits raffles, seating plans, and picking students by number. You can't ask for more numbers than the range holds: 11 different numbers from 1 to 10 isn't possible, and the generator tells you so.

Switch it off when each number should be a separate draw, like rolling a die again and again. Then any number can turn up more than once, and every draw gives every number the same chance, whatever came before. The next draw starts fresh either way: No repeats only applies within one draw.

Lottery numbers, dice, and other quick ranges

The quick ranges set up common draws in one tap:

  • 1 to 10, 1 to 100, and 1 to 1,000 for everyday picks.
  • Dice (1 to 6) gives one number, like a single die. For several dice with totals and a chart, roll a die instead.
  • 6 of 49 draws six different numbers from 1 to 49 and sorts them, the shape of many lotteries. There are 13,983,816 possible sets, and each is equally likely.

No generator can make a lottery ticket more likely to win. Every set of six has the same 1 in 13,983,816 chance of matching a 6 of 49 draw, including the sets that look like patterns.

Is this random number generator fair?

Yes. Each number starts as a raw 32-bit value from your browser's cryptographic generator, the kind built for making encryption keys. Turning that into 1 to 100 with a plain remainder would favor 1 to 96 very slightly, because 4,294,967,296 isn't a multiple of 100: 2^32 mod 100 = 96. So those top 96 raw values are thrown away and redrawn whenever they come up, a method called rejection sampling, and every number from 1 to 100 ends up with exactly the same chance. The 1 to 1,000 range throws back 296 values, and ranges wider than about 4.3 billion use 53 random bits the same way.

No repeats uses a Fisher–Yates shuffle on just the part of the range it needs, so every set of numbers, and every order, is equally likely. In a 6 of 49 draw, the first number is one of 49, with 39 leftover raw values set aside, then one of the 48 left, and so on. All numbers are decided the moment you press Generate. The digits that flash for about two-thirds of a second before a single number lands are only for show.

Sorting, sums, averages, and copying

When you draw several numbers, the result line lists them with their sum and average. Turn on Sort the results to show them from smallest to largest; leave it off to see them in the order they were drawn, which matters for a prize draw. Over many draws, the average settles near the middle of the range: 5.5 for 1 to 10 and 50.5 for 1 to 100.

The copy button puts the numbers on your clipboard as plain digits separated by commas, ready for a spreadsheet, a chat, or a document. Recent numbers keeps your last 20 draws with their ranges, newest first, and Clear empties it.

Why random numbers repeat: the birthday problem

People expect repeats to be rare, but they turn up fast. Draw 13 numbers from 1 to 100 with repeats allowed and there's a 55.7% chance that at least two are the same. It's the same math as the birthday problem: in a group of just 23 people, the chance that two share a birthday is 50.7%.

The flip side is that some numbers stay away for a long time. Draw 100 numbers from 1 to 100 and each number has a 36.6% chance of never coming up, so on average about 37 of the hundred don't appear at all. Gaps and clusters like these are what randomness looks like.

Uses in class, in games, and for seating

Teachers use it to call on students by class number, pick a page to read, or make quick practice sums. It also settles who goes first in a game, chooses a winning raffle ticket, assigns seats or teams, and picks a random line from a numbered list. For a list of names rather than numbers, the random name picker does the same job with a wheel.

Tap, type, or press G

The big number doubles as a button, so on a phone one tap draws again, and on a computer you never need to leave the keyboard:

  • Touch or mouse: tap the big number or the Generate button, and use the plus and minus buttons to change the count.
  • Keyboard: press Enter in any box, or press Space, Enter, or G while the generator is on screen.
  • Screen readers: the buttons have labels, and each result, with its range, sum, and average, is announced.

With reduced motion turned on, a single number appears without its roll. When From equals To there's nothing to roll, so that number shows at once too.

A short history of random numbers

Before computers, people who needed random numbers looked them up. In 1927 the statistician L. H. C. Tippett published a table of 41,600 random digits, the first of its kind. In 1955 the RAND Corporation published A Million Random Digits with 100,000 Normal Deviates, made with an electronic roulette wheel. In 1938 Ronald Fisher and Frank Yates described the shuffle that computers still use to put things in a random order.

What the generator remembers

There's no account to create. The page needs a connection to load, but the numbers are drawn in your browser and aren't sent to a server. Your range, count, No repeats and Sort settings, and last 20 draws are kept in this browser's local storage for next time, as the privacy policy explains. Clear next to Recent numbers removes the saved draws.

FAQ

Random number generator questions

Quick answers about ranges, no repeats, lottery numbers, fairness, copying, and saving.

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

Type 1 in From and 100 in To, or tap the 1 to 100 quick range, then press Generate. Both ends are included, so every number from 1 to 100 has a 1% chance.

Is this random number generator truly random?

Its numbers come from the cryptographic generator built into your browser, and rejection sampling removes the tiny bias a plain remainder would add, so from 1 to 10 each number is exactly 10% likely (6 raw values out of 4,294,967,296 are redrawn).

Can I generate random numbers without repeats?

Yes. Keep No repeats on and every number in a draw is different. You can't ask for more numbers than the range holds, such as 11 different numbers from 1 to 10.

How many numbers can I generate at once?

Up to 500 in one draw. Use the plus and minus buttons or type the amount in the box between them.

Can I use negative or very large numbers?

Yes. Any whole numbers from −9,007,199,254,740,991 to 9,007,199,254,740,991 work, and a range can hold up to about 9 quadrillion numbers. Spaces and commas in what you type are ignored.

Can I use it to pick lottery numbers?

Yes. The 6 of 49 quick range draws six different numbers from 1 to 49 and sorts them. All 13,983,816 possible sets are equally likely, so no set has a better chance than another.

Why did the same number come up twice?

Either No repeats is off, so each number is a separate draw, or the numbers came from two different draws. No repeats only keeps the numbers within one draw different.

How do I copy the numbers into a spreadsheet?

Press the copy button next to Generate. The numbers go on your clipboard as plain digits separated by commas. If your browser blocks it, select the numbers and copy them yourself.

Does the generator remember my range next time?

Yes. Your range, options, and last 20 draws reload the next time you open the page in this browser. Back to 1 to 100 restores the default range, and Clear, next to Recent numbers, wipes the draws.