CalcKit CalcKit
My Calculators
Sign in Sign up

Random Number Generator

Generate random numbers between any two whole numbers: one, or a list of up to 10,000, with or without repeats, sorted or not, drawn by a secure generator.

Random Number Generator: A Quick Guide

Pick one random number or a whole list between any two whole numbers, with or without repeats, sorted or not. The numbers come from your browser's cryptographic random generator, and every number in the range is exactly as likely as any other.

How to use the generator

  1. Set the range with From and To. Both numbers can come up, and they can be negative or given in either order.
  2. Choose how many numbers you want, from 1 to 10,000.
  3. Turn on No repeats if each number may come up only once, as when drawing raffle winners or lottery numbers.
  4. Pick a sort order if you want the list from smallest to largest, or the other way round.
  5. Press Generate, or Enter in any field. Each press gives a new draw. Copy puts the numbers on your clipboard, separated by commas.

Examples

To do thisFromToHow manyNo repeats
Roll a die161off
Roll two dice162off
Flip a coin (1 heads, 2 tails)121off
Pick 6 lottery numbers out of 491496on, sorted
Draw 3 raffle winners from tickets 1 to 50015003on
Shuffle the numbers 1 to 1011010on

How random are the numbers?

They come from crypto.getRandomValues, the generator browsers use for encryption keys, not from the predictable Math.random. Turning its random bits into a number in your range is done with rejection sampling: a draw that would fall in the uneven leftover part of the bits is thrown away and drawn again. A simple remainder would make the lower numbers of some ranges slightly more likely; this way each of the To - From + 1 numbers has exactly the same chance.

With No repeats, the numbers are drawn the way a raffle drum works: once a number is out, it can't come up again. Taking every number of the range gives a random order of the whole range, a shuffle.

Frequently asked questions

Is this random number generator truly random?

It uses your device's cryptographic generator, which is seeded from unpredictable events in the hardware and the operating system. For games, draws, decisions and sampling it is as random as it gets; nobody, this site included, can predict or repeat a draw.

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

Set From to 1 and To to 100, the values the page starts with, and press Generate. Both 1 and 100 can come up.

Can I generate random numbers without repeats?

Yes: turn on No repeats. You can then ask for at most as many numbers as there are in the range, To - From + 1.

Are the numbers saved anywhere?

No. They are made in your browser and never sent to a server, so nobody else sees them.