Two glossy dice tumbling in mid-air over a deep blue gradient, illustrating random number generation

A number generator picks a random number for you — in any range you choose, in a second. Type in a minimum and a maximum, press a button, and you get a number with no pattern behind it. No maths, no dice, no spreadsheet formulas. That is the whole job, and it is the reason giveaways, classrooms, and developers all reach for one.

The catch is that not every generator is equally random, and the wrong one can quietly ruin a draw. This guide shows you how to generate a random number in any range, how to get numbers with no repeats, and which method fits your job — plus the mistakes that make a "random" pick anything but random.

How a Number Generator Works

Most online generators use a pseudo-random number generator, or PRNG. It starts from a seed value and runs it through maths that produces numbers looking random. The same seed always produces the same sequence, which is why a PRNG is fine for a giveaway but never for security. True random generators, like the ones at random.org, measure atmospheric noise instead, so no seed exists to repeat.

Random Number Generator Online Free: Get a Number in Any Range

The fastest way is a free online generator: enter your lowest and highest numbers and press generate. The result lands instantly, and you can press again for another. For a draw between 1 and 100, that is all there is to it — one click, one number, no setup. Keep the range tight and the job honest: a range of 1 to 1,000 gives every number the same chance, which is exactly what a fair draw needs.

With repeats or without repeats?

Two modes matter. With repeats allowed, each pick is independent, so the same number can appear twice — like rolling a die again. With no repeats, each number is used once and then removed from the pool, like drawing names from a hat. For a giveaway with three winners, you want no repeats; for rolling dice, you want repeats.

A giveaway, worked through

Say you run a giveaway with 120 entries and two prizes. Set the range to 1–120 and generate with no repeats. Suppose the first pick is 47 and the second is 103: those are your winners, and nobody can claim the draw was fixed, because every entry had the same 1-in-120 chance. Write the numbers down before announcing them, and keep a screenshot — transparency is what makes a random draw trusted.

Number Generator 1 to 16: A Small Range, Done Right

Small ranges show up more than you would think: picking one of 16 players, choosing a table, or assigning 16 teams to slots. A number generator 1 to 16 handles it in one click, and with no repeats it can shuffle all 16 in order. The trick is the same as with big ranges — every number must have an equal chance, or the pick is biased before it starts.

Where Random Numbers Are Actually Used

Giveaways are the obvious one, but random numbers do quiet work everywhere. Researchers use them to pick a fair sample from a list. Teachers use them to call on students without favouritism. Developers use them to create test data, shuffle playlists, and deal cards in games. Even the password generator on this site leans on randomness — a strong password is, at its core, a string of random choices.

Numbers also act as identifiers. Barcodes are built from numbers, and a barcode generator turns a product number into a scannable pattern. QR codes work the same way: a ticket or a pass often carries a random number inside the code, which is why making a QR code and generating the number behind it go hand in hand.

Ways to Generate a Random Number, Compared

Method Best for Randomness Effort
Online generator Giveaways, quick picks Good (PRNG) One click
random.org Draws needing true randomness True random One click
Spreadsheet (RANDBETWEEN) Repeated draws in a list Good (PRNG) A formula
Code (Python, JavaScript) Apps and testing Good (PRNG) A few lines
Dice or cards In-person draws True random Physical setup

Are Online Number Generators Really Random?

For everyday use, yes — close enough that nobody can tell the difference. A modern PRNG produces sequences that pass statistical tests for randomness, and for a giveaway or a classroom pick that is all you need. The exception is anything involving money, security, or gambling: there you want true randomness, from a service such as random.org, which samples atmospheric noise, or from your operating system's cryptographic generator.

One more check matters: the generator must not favour some numbers. A sloppy tool can quietly bias results — for example, if it divides a range unevenly, the first numbers come up more often. Stick to a well-known tool, and if the stakes are high, test it: generate a few hundred numbers and check the spread. A fair generator spreads them evenly.

Mistakes That Make a "Random" Pick Unfair

The classic mistake is the off-by-one error: asking for 1 to 100 but getting 0 to 99, or excluding the top number. Always confirm the range includes both ends. Another is reusing the same seed — some tools seed from the time of day, so two draws a second apart can match. And never pick the winner by hand after generating the number; the whole point is that no human touches the result.

How to Run a Fair Giveaway With a Number Generator

A random number only makes a draw fair if the process around it is fair too. Publish the rules before the draw: who can enter, how entries are numbered, and when the winner is picked. Number every entry in order, from 1 to the total count, and generate the winning number live or on video. Announce the winning number, not just the name, so anyone can check it against the entry list.

  • Number entries 1 to N with no gaps
  • Use no-repeats mode for multiple winners
  • Screenshot the generated numbers before announcing
  • Publish the winning number, not just the name
  • Keep the entry list so the draw can be checked

How to Generate a Random Number in Code

If you build software, you will need random numbers in code, not in a browser tab. JavaScript has Math.random, which returns a decimal between 0 and 1; multiply it by your range and round down. Python has a random module with randint for a range and sample for picks with no repeats. The MDN documentation for Math.random shows the exact pattern for a whole number in a range, and it is worth bookmarking if you write JavaScript.

// Random whole number from 1 to 100 in JavaScript
function randomInt(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
randomInt(1, 100); // e.g. 47

# Random whole number from 1 to 100 in Python
import random
random.randint(1, 100)  # e.g. 73
random.sample(range(1, 101), 5)  # five numbers, no repeats

Frequently Asked Questions

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

Use a free online number generator: set the range to 1–100 and press generate. In Excel or Google Sheets, =RANDBETWEEN(1,100) does the same. In JavaScript, Math.floor(Math.random() * 100) + 1 gives a whole number from 1 to 100.

Can I get a random number generator with no repeats?

Yes. Choose a generator with a "no repeats" or "unique numbers" option: it draws each number once, like names from a hat. In Python, random.sample(range(1, 101), 5) returns five different numbers from 1 to 100. For giveaways with several winners, no-repeats is the fair choice.

Are online number generators truly random?

Most use a pseudo-random number generator, which is random enough for giveaways, sampling, and games. For money or security, use true randomness: random.org samples atmospheric noise, and operating systems offer cryptographic generators. A fair generator gives every number in the range the same chance.

How do I generate a random number in Excel or Google Sheets?

Type =RANDBETWEEN(1,100) into a cell. It returns a whole number between 1 and 100, and it recalculates every time the sheet changes. For a fixed draw, copy the result and paste it as a value before announcing the winner.

What is a number generator 1 to 16 used for?

Picking one of 16 players, teams, tables, or options. Set the range to 1–16 and generate once for a single pick, or generate with no repeats to shuffle all 16 in order. The same fairness rule applies: every number must have an equal chance.

By Rahib Ali