๐Ÿ‡บ๐Ÿ‡ธ USC
Everyday & Time
๐ŸŽฒ

Random Number Generator

Pick one or more random numbers in any range

๐ŸŽฒ Settings

โœจ Your random number

86
between 1 and 100

Press Generate again for a fresh draw.

These numbers come from your browser's Math.random(), a fast pseudo-random generator suitable for games, raffles, sampling and everyday picks. It is not cryptographically secure, so do not use it to generate passwords, security keys or anything where predictability would be a risk.

โœ…

Last updated June 2026

Method: Integers are drawn uniformly over your inclusive range using the browser's Math.random() pseudo-random generator. Unique draws use a partial Fisher-Yates shuffle so no value repeats.

Included: Custom min/max (including negatives), any count up to 10,000, a unique (no-repeats) toggle, optional sorting, and summary stats for multi-number draws.

Not included: Cryptographically secure randomness, decimal output, and weighted or non-uniform distributions. Use a security-grade generator for passwords or keys.

Random number generator: everything you need to know

A random number generator (often shortened to RNG) does one simple, surprisingly useful thing: it picks a number you cannot predict in advance. Want to roll a die, draw a raffle winner, pick a lottery line, choose a random row from a spreadsheet, settle a "you decide" debate, or pull an unbiased sample? Instead of relying on a "random" number you thought up in your head - which is almost never actually random - you set a range, press Generate, and get a fair, uniform pick. Set the range to 1 and 100, leave the count at 1, and the tool returns a single number where every value from 1 to 100 was equally likely.

What "random" means here

Every integer in your range has the same probability of being chosen - that is what makes the draw fair. This is called a uniform distribution: on a 1-6 generator each face has a 1-in-6 chance, exactly like a physical die. The generator does not "remember" past draws and does not avoid recently seen numbers, so streaks and repeats are normal and expected. There is no pattern to exploit and no number that is "due."

The formula behind the draw

Browsers provide Math.random(), which returns a decimal in the half-open interval [0, 1) - that is, 0 is possible but 1 is not. To turn that into a whole number within your inclusive range, the generator uses the standard scaling formula:

result = min + ⌊ Math.random() × (max − min + 1) ⌋

The + 1 and the floor (round-down) together make both ends inclusive, so a range of 1 to 6 can return 1, 6, or anything between, each with equal odds. For a draw of several numbers, the generator simply repeats this step - or, when you ask for unique values, it shuffles the range and takes the first few so nothing repeats.

How to use this random number generator

  1. Set the minimum and maximum. These are the smallest and largest numbers that can be drawn, and both are included in the range. Negatives are allowed.
  2. Choose how many numbers you want in a single draw - one for a quick pick, or several for a list. Quick buttons offer 1, 5, 6, and 10.
  3. Toggle "unique" if no number may repeat within the draw (for example, lottery lines or drawing names). Leave it off if repeats are fine, like rolling several dice.
  4. Optionally sort the results in ascending order to make a multi-number draw easier to read.
  5. Press Generate. The result appears instantly. Press it again any time for a fresh, independent draw.

Who this tool is for

  • Teachers and presenters cold-calling a student number or picking a group at random.
  • Giveaway and raffle hosts drawing a winner from a numbered list of entrants.
  • Gamers and tabletop players who need dice, a coin flip, or a random card index without physical props.
  • Researchers and analysts pulling a random sample of rows, IDs, or participants to reduce bias.
  • Anyone making a decision - assigning chores, picking who goes first, or settling a friendly tie.

Worked example 1: roll two dice

Set the minimum to 1, the maximum to 6, the count to 2, and leave "unique" off (because two real dice can both show the same face). Press Generate and you might get 4 and 4, or 2 and 5. Each die is independent, so doubles are perfectly possible - on average they come up about 1 roll in 6.

Worked example 2: a lottery line

To mimic a 6-from-49 lottery, set the range to 1-49, the count to 6, and turn "unique" on so no ball repeats. A draw might return 3, 11, 17, 28, 36, 44. Turn on "sort ascending" and the same draw reads in order, just like an official result. Because the numbers are unique and uniform, every combination is equally likely - there is no "smart" set of numbers.

Worked example 3: pick a random winner

Suppose 250 people entered a giveaway and you numbered the entries 1 to 250. Set the minimum to 1, the maximum to 250, and the count to 1. Press Generate and the tool returns a single number - say 137 - identifying the winning entry. To draw three winners with no one winning twice, set the count to 3 and turn on "unique."

Quick reference: common settings

Here are the settings for the most common everyday uses:

Use case Range Count Unique
Coin flip (1 = heads)1 - 21-
Single die1 - 61-
Two dice1 - 62Off
Percentage (0-100)0 - 1001-
Lottery (6 of 49)1 - 496On
Pick a winner (200 entries)1 - 2001-

Key terms explained

  • Range: the span between your minimum and maximum, including both endpoints. A range of 1-100 contains 100 possible values.
  • Uniform distribution: every value in the range is equally likely. This tool always uses a uniform distribution - it does not weight any number more heavily than another.
  • Pseudo-random (PRNG): a number sequence produced by an algorithm that looks random and passes statistical tests, but is generated deterministically from an internal starting point (seed).
  • Cryptographically secure (CSPRNG): a stronger generator designed so that outputs cannot be predicted even by an attacker who has seen previous values. Required for passwords and keys - not what this tool uses.
  • With vs. without replacement: "without replacement" means each pick is removed from the pool so it cannot recur - that is what the "unique" toggle does. "With replacement" (unique off) lets values repeat.

Pseudo-random vs. cryptographically secure

This tool uses Math.random(), a pseudo-random generator. For games, raffles, sampling, classroom picks, and decisions, it is fast, fair, and more than good enough - the output is statistically uniform and you would never notice a difference from "true" randomness. However, it is not cryptographically secure: a sufficiently determined attacker who observes enough outputs could, in principle, predict future ones. That is why you should never use this (or any Math.random()-based tool) to create passwords, security tokens, encryption keys, or anything where an opponent benefits from guessing the next number. For those, use a dedicated CSPRNG built into your operating system or programming language.

Tips for getting the result you want

  • Need decimals? Generate a whole number over a larger range, then divide. For a value between 0.00 and 1.00, draw 0-100 and divide by 100.
  • Picking from a named list? Number your items 1 to N, draw a number, and match it back to the name.
  • Want every item exactly once (a shuffle)? Set the range to cover your whole list, the count to the list length, and turn "unique" on - the result is a random ordering.
  • Drawing names without repeats? Always turn on "unique" so the same person cannot be picked twice.
  • Re-rolls are fine. If you do not like a draw, pressing Generate again is itself random - it does not bias the next result.

Related concepts and tools

A random number generator is the engine behind dice rollers, coin flippers, name pickers, password generators, raffle drawers, and statistical sampling tools - they all dress up the same uniform draw for a specific job. If you want to reason about the odds of a particular outcome rather than just draw one, the Probability Calculator works out the likelihood, and the Permutation & Combination Calculator counts how many distinct draws or orderings are even possible. Once you have a list of generated numbers, the Average Calculator and Standard Deviation Calculator summarize and spread-check them, and the Z-Score Calculator tells you how unusual any single value is.

Random sampling without bias

One of the most valuable jobs a random number generator does is pull an unbiased sample. Suppose you have a list of 5,000 customer records and you want to audit 50 of them. If you eyeball the list and "pick some," you will unconsciously favor familiar names, round-numbered rows, or entries near the top - and your audit will be skewed before it starts. Instead, number the rows 1 to 5,000, set the range accordingly, set the count to 50, turn "unique" on (you do not want to audit the same record twice), and let the tool draw the sample. This is called simple random sampling, and it gives every record an equal chance of selection, which is the foundation of any defensible statistical inference. The same method works for quality-control spot checks, A/B test group assignment, jury-style selection, and survey respondent picking. When the sample is genuinely random, you can use the Standard Deviation Calculator to estimate how confident you can be that the sample reflects the whole group.

Simulating dice, cards, and games of chance

Tabletop and board games lean heavily on randomness, and a generator can replace almost any physical randomizer. A standard six-sided die is a 1-6 draw; a twenty-sided die (d20) used in role-playing games is a 1-20 draw; percentile dice are 1-100. Need to draw a card from a 52-card deck? Number the cards 1 to 52, draw one, and map the result back (1-13 hearts, 14-26 spades, and so on). To deal a five-card hand, set the count to 5 with "unique" on so no card appears twice. Because each draw is independent and uniform, the long-run behavior matches the real prop exactly - a fair die, a fair shuffle, a fair coin. If you want to know how likely a particular roll or hand actually is before you draw it, pair this generator with the Probability Calculator to compute the odds.

Lottery picks and the math behind them

Plenty of people use a random number generator to choose lottery lines, and the tool is perfectly suited to it: set the range to the game's number pool (for example 1-49 or 1-69), set the count to how many balls are drawn, and turn "unique" on. What the generator cannot do is improve your odds, because in a fair lottery every valid combination is equally likely - a "random" line such as 4, 8, 15, 16, 23, 42 has exactly the same chance as 1, 2, 3, 4, 5, 6. The real value of generating your numbers is avoiding the human tendency to crowd around birthdays (1-31) and lucky numbers, which means if you do win a popular pattern you are more likely to share the jackpot. To see how steep the odds truly are, the Permutation & Combination Calculator shows how many possible combinations exist, and if you ever do win, the Lottery Tax Calculator estimates what you would actually take home after federal and state tax.

Picking names and assigning groups fairly

Teachers, managers, and event hosts constantly need to choose people at random - cold-calling a student, drawing a prize winner, deciding turn order, or splitting a class into project teams. The reliable method is always the same: build a numbered list of everyone, then draw against it. To pick one person, draw a single number. To pick several winners with nobody winning twice, raise the count and turn "unique" on. To split 24 people into 4 teams, generate a unique random ordering of 1-24 (count 24, unique on, sort off) and deal them out in blocks of six - the first six numbers are team one, the next six team two, and so on. Doing it this way removes any accusation of favoritism, because the assignment is transparent and reproducible: anyone can see that the draw was uniform and that no name carried extra weight.

Generating decimals, percentages, and ranges with steps

This tool draws whole integers, but a little arithmetic extends it to almost any numeric format you need. For a random percentage, draw 0-100. For a value between 0.00 and 1.00, draw 0-100 and divide by 100; for three decimal places, draw 0-1000 and divide by 1,000. To pick a random price like $0.00-$50.00, draw 0-5000 (cents) and divide by 100. If you need values that fall only on a fixed step - say multiples of 5 between 0 and 100 - draw 0-20 and multiply by 5. The principle is to map your target range onto a clean integer range, draw, then scale or shift the result. This keeps every outcome uniform, because multiplying or dividing a uniform draw by a constant preserves the equal-chance property. When you later want to describe the spread of those scaled values, the Average Calculator gives the center and the Standard Deviation Calculator gives the spread.

How seeds and reproducibility work

Every pseudo-random generator starts from an internal seed - a starting value that determines the entire sequence of "random" numbers that follow. In a browser, Math.random() is seeded automatically and you cannot set or read that seed, which is why this tool gives a fresh, unpredictable result on every press and why you cannot reproduce a past draw exactly. That is the right behavior for raffles, games, and picks, where you want each draw to be independent and tamper-proof. In programming and scientific simulation, by contrast, people often do set a fixed seed on purpose, so that a colleague running the same code gets the identical "random" sequence and can verify the result. If reproducibility matters for your work - repeatable experiments, debugging a simulation, or sharing an exact sample - you will need a seeded generator in a spreadsheet or programming language rather than a browser tool, because by design this page never exposes its seed.

Limitations and assumptions

  • It produces whole integers only; decimal bounds are rounded inward before the draw.
  • It uses a uniform distribution - there is no way to weight some numbers more than others.
  • It is pseudo-random, not cryptographically secure; do not use it for security-sensitive values.
  • Draws are capped at 10,000 numbers to keep the page responsive.
  • You cannot request more unique numbers than the range contains.

โš ๏ธ Common mistakes & edge cases

Asking for more unique numbers than exist

You cannot draw 10 unique numbers from a range of 1-6, because only six distinct values exist. The tool will flag this - either lower the count or widen the range.

Expecting "no repeats" with unique off

With "unique" turned off, every pick is independent, so repeats are normal and expected - especially over a small range. Turn "unique" on whenever each number must be different.

Using it for passwords or keys

Math.random() is fast but predictable to an attacker. Never use it for passwords, tokens, or encryption keys - use a cryptographically secure generator for anything security-related.

Forgetting the range is inclusive

A range of 1-100 can return both 1 and 100. If you want results from 1 to 99, set the maximum to 99. Decimal bounds round inward, so 2.5-9.5 becomes 3-9.

Note: Results are pseudo-random and meant for everyday use - games, raffles, sampling and decisions. Do not use them for security-sensitive values.

❓ Frequently asked questions

How does this random number generator work?

You set a minimum and a maximum, choose how many numbers you want, and decide whether they must be unique. The tool then draws integers in that inclusive range using your browser's Math.random() function. Each integer in the range has an equal chance of being picked, so a 1 to 6 generator behaves like a fair die and a 1 to 49 generator behaves like a lottery draw.

Are the numbers inclusive of the minimum and maximum?

Yes. The range is inclusive on both ends, so a range of 1 to 100 can return 1, 100, or anything in between. Internally the generator rounds the minimum up and the maximum down to whole numbers, then picks uniformly across every integer from the low value to the high value.

What does the 'unique' option do?

When 'unique' is on, no number is repeated within a single draw - useful for picking lottery numbers, drawing names, or shuffling a list. When it is off, the same number can appear more than once, like rolling several independent dice. You cannot request more unique numbers than the range contains; for example, you cannot draw 10 unique numbers from a range of only 6 values.

Is this generator truly random?

It is pseudo-random. Math.random() uses a deterministic algorithm seeded by the browser that produces a sequence statistically indistinguishable from random for everyday use - games, raffles, sampling, decisions. It is not cryptographically secure, meaning a determined attacker could in theory predict future outputs, so it should not be used for passwords, tokens, or security keys.

Can I use this to roll dice or flip a coin?

Yes. For a single six-sided die, set the range to 1-6 and count to 1. For two dice, set count to 2 with unique turned off. For a coin flip, use a range of 1-2 (1 = heads, 2 = tails) or 0-1. The 1, 5, 6 and 10 quick buttons make common counts fast to set.

How many numbers can I generate at once?

You can request up to 10,000 numbers in a single draw. That limit keeps the page responsive in the browser. If you need a very large dataset for analysis or simulation, a spreadsheet or programming language is a better tool, but for picks, samples and lists this range is more than enough.

Why do I sometimes get the same number twice?

With the 'unique' option off, every draw is independent, so repeats are completely normal - in fact they are expected. If you draw 10 numbers from 1 to 6, you will almost always see duplicates because there are only six possible values. Turn on 'unique' if you need every number in the draw to be different.

Can I pick negative numbers or a range that crosses zero?

Yes. You can enter negative values for the minimum, the maximum, or both - for example -50 to 50, or -10 to -1. The generator simply picks uniformly across every integer in the span you define, including zero and negative numbers.

Does it generate decimals, or only whole numbers?

This tool generates whole integers only. If you enter decimal bounds, the minimum is rounded up and the maximum is rounded down to the nearest integers before the draw. For random decimals or percentages, multiply or divide the result yourself - for example, divide a 0-100 result by 100 to get two-decimal values between 0.00 and 1.00.

Is the result saved or sent anywhere?

No. Everything runs locally in your browser. Nothing you enter and no number you generate is stored, logged, or transmitted to a server, so each draw is private to your device. Refreshing the page resets the generator to its defaults.

๐Ÿ’ก Good to know

Humans are bad at being random

When people are asked to "pick a random number," they cluster around certain values (7 is famously over-chosen) and avoid repeats and round numbers. A generator removes that bias, which matters for fair draws and unbiased samples.

No number is ever "due"

Each draw is independent. If 7 has not appeared in your last ten rolls, it is not any more likely to come up next - believing otherwise is the gambler's fallacy. Streaks and gaps are a normal feature of true randomness.

Everything stays on your device

The generator runs entirely in your browser. Your inputs and the numbers you generate are never sent to a server, stored, or logged - each draw is private and disappears when you refresh.

Related Calculators