Random Number Generator

Generate one or more random numbers within a range you choose, with full control over type, quantity and sorting.

Free online random number generator. Generate one or many numbers in any range — whole or decimal, unique or repeated, sorted or shuffled.

How it works

A random number generator (RNG) picks one or more values from a range you define. You set a minimum and a maximum, choose how many numbers you want, and decide whether they should be whole numbers or decimals. The moment you press Generate, the tool asks your browser for cryptographically secure random bytes through the Web Crypto API, then maps those bytes into your chosen range.

The mapping step matters more than people realise. A naive approach — taking a random byte and using the remainder after dividing by the range size — can quietly favour some numbers over others. This is called modulo bias. To avoid it, this tool uses rejection sampling: it draws random bits, checks whether the result falls inside a clean multiple of your range, and if not, throws it away and draws again. The result is that every number in your range has an exactly equal probability of being selected.

When you ask for several numbers at once, the tool decides how to handle repeats. With duplicates allowed, each draw is independent — the same value can appear more than once, just like rolling a die repeatedly. With duplicates disabled, the tool builds a pool of every valid number in your range, shuffles it with a Fisher–Yates shuffle powered by secure randomness, and takes the first N values. That guarantees a fair, unique selection with no repeats.

Decimal mode works the same way, except the final value is rounded to the number of decimal places you choose (up to ten). Sorting is applied only after generation, so it never affects the randomness — it simply reorders the already-fair results for easier reading.

Examples

  • Raffle and giveaway draws. Assign each entry a number, then generate one random number in that range to pick a winner fairly and transparently.
  • Maths and statistics practice. Teachers generate random datasets — say, 20 numbers between 1 and 100 — so students can calculate mean, median and range on fresh data each lesson.
  • Lottery-style number picks. Generate 6 unique numbers from 1 to 49 with duplicates disabled to simulate a lottery draw for a friendly office pool.
  • Software and data testing. Developers create decimal test values with two decimal places to populate mock spreadsheets, invoices or database seeds.
  • Classroom cold-call selection. Number your students and generate a single random integer to choose who answers the next question — no favouritism, no patterns to exploit.

Common uses

  • Classroom activities
  • Giveaways and competitions
  • Games and simulations
  • Sampling and testing

Fairness and privacy

Every number in your range has an exactly equal chance of being chosen. Rejection sampling removes modulo bias, and the Fisher–Yates shuffle guarantees unique selections are unbiased. The same secure randomness source is used for every draw, and no previous result ever changes the odds of the next one.

Random results are generated locally in your browser using secure browser randomness (Web Crypto crypto.getRandomValues()) where supported, with equal probability for every valid entry. No account is required, your lists are processed in the browser and never uploaded, names are not sent to analytics, and optional history stays only in your local browser storage. This tool is not for regulated gambling or official lotteries.

Frequently asked questions

How does the random number generator work?

It asks your browser for cryptographically secure random bytes through the Web Crypto API, then maps those bytes into your chosen range using rejection sampling. This avoids modulo bias, so every number in the range has an exactly equal chance of being selected.

Why is this tool fair?

Fairness comes from two places: rejection sampling removes the bias that simple remainder-based generators introduce, and the Fisher–Yates shuffle (used when duplicates are off) guarantees unique draws are unbiased. No entry is ever secretly favoured, and advertising or past results never influence the outcome.

Are the results truly random?

They use your browser’s secure Web Crypto randomness where available, with rejection sampling to avoid bias. The output is statistically random and unpredictable — ideal for everyday, educational and low-stakes use, but not certified for regulated gambling or cryptographic key generation.

Can I use this for an official lottery or raffle?

For a friendly office raffle or classroom draw, yes. For a regulated, licensed lottery or legally binding draw, you should use a system designed and certified for that purpose. This tool is intended for entertainment, education and ordinary choices.

What is the difference between whole and decimal numbers?

Whole numbers are integers with no fractional part (for example 7). Decimal numbers include fractional parts rounded to the precision you choose (for example 7.42). Decimal mode is useful for test data, statistics and simulations.

How accurate are the results?

Every value is drawn with equal probability across your exact range, so the distribution is uniform. Over many thousands of draws, each number appears roughly the same number of times — which is exactly what a fair generator should do.

What is the difference between this and the Random Integer Generator?

This tool handles batches: multiple numbers at once, decimal values, sorting and duplicate control. The Random Integer Generator is a streamlined tool that returns a single whole number with one click — ideal when you just need one quick pick.

Can I generate numbers without repeats?

Yes. Untick “Allow duplicates” and the tool shuffles every valid number in your range, then takes the first N — guaranteeing unique values. If you ask for more unique numbers than the range contains, it will warn you.

Are my entries stored or uploaded?

No. Everything runs locally in your browser. Your settings and results are never sent to a server, and optional history stays only on your device.

Does a previous result affect the next one?

No. Each generation is independent. A run of the same number does not make the next value more or less likely to change — that is a common gambler’s-fallacy misconception.

Related tools

  • Random Name Picker — Select one or more names fairly from any list — a random classroom name picker for teachers, giveaways and meetings.
  • Wheel Spinner — Create an interactive spinning wheel of names, choices or activities.
  • Coin Flip — Simulate one or more fair coin flips with an even 50% chance of heads or tails.
  • Dice Roller — Roll standard and RPG dice using notation such as 2d6 or 1d20+5.
  • Random Team Generator — Divide a list of people into fair, random teams that differ by no more than one member.