100 free tools for text, SEO, developers, DNS and imagesEvery tool runs locally in your browser. No sign-up. Nothing is uploaded.

Random Number Generator

Generate random numbers in any range using a secure random source: unique or repeatable, sorted, with sum and average. Free, no sign-up, and it runs in your browser.

Dedicated page: /en/random-number-generator

Quick answer

A random number generator picks numbers within a range you set, with options for how many numbers, whether duplicates are allowed, and sorting. Use it for raffles, giveaways, classroom picks, sample data and games, generated with your browser's secure random source.

About this Random Number Generator

Generate random numbers in any range using a secure random source: unique or repeatable, sorted, with sum and average. It is one of the Calculators and Generators on ToolUstad, and like every tool here it runs entirely in your browser: nothing you type, paste or open is uploaded to a server, and there is no sign-up or usage limit.

What is a random number generator?

A random number generator, or RNG, produces numbers with no predictable pattern. Computers offer two kinds: pseudo random generators, which use an algorithm seeded with an unpredictable value, and hardware generators, which measure physical noise. This tool uses the cryptographic random source built into your browser (crypto.getRandomValues), the same quality of randomness used for security work, and maps it onto your chosen range without bias.

Options and what they are for

OptionUse it when
Minimum and maximumDefining the pool, like 1 to 49 for a lottery style draw
CountYou need several numbers at once, like 6 draw numbers
No duplicatesDraws where each number may appear only once, like raffles
Allow duplicatesDice style rolls and simulations where repeats are natural
Sort ascendingPresenting results neatly, as lottery results are shown

When and why to generate random numbers

  • Raffles and giveaways: pick a winning entry number fairly and transparently.
  • Teachers: choose students for questions without favouritism.
  • Games and decisions: dice substitutes, coin flips and picking who goes first.
  • Sampling and testing: select random rows, IDs or test values from a range.
  • Statistics practice: generate data sets for probability exercises.

Best practices

  • Set the range to exactly the pool size: for 37 entries, generate 1 to 37, not 1 to 100.
  • Turn duplicates off for draws from a finite list of entrants.
  • Record the draw settings and result together if the result decides a prize.

Common mistakes to avoid

  • Generating numbers with duplicates allowed, then redrawing silently when a repeat appears: that biases the draw.
  • Using a small range repeatedly and suspecting the tool when repeats occur naturally: that is what random means.
  • Using any RNG, including this one, for cryptographic keys: use dedicated security tools for that job.

Who is the random number generator for?

Teachers, event organisers, gamers, developers and anyone running a fair draw. Picking a number "in your head" is demonstrably not random: people favour middle values and avoid repeats. The generator removes human bias and, with the sum and average displayed, doubles as a quick statistics helper.

Fair draws, documented

If a draw decides anything of value, treat it like a result that may be audited. Decide the range and count before generating, generate once, and screenshot or record the settings alongside the numbers, because redrawing until a preferred number appears is indistinguishable from rigging. For classroom and community draws, projecting the generation live solves the trust question completely. The generator's displayed sum and average also make it handy for quick probability demonstrations: roll two dice a hundred times with duplicates allowed and watch the average settle near 7, the most likely total, exactly as theory predicts.

Learn: how to use the Random Number Generator

  1. Set the minimum and maximum for your range.
  2. Choose how many numbers you need, and tick unique if duplicates are not allowed, such as a raffle or lottery pick.
  3. Generate, then sort, copy or download the set. The stats row shows sum, average, smallest and largest.

Features

  • Cryptographic randomness from the Web Crypto API, with rejection sampling so every number is equally likely
  • Unique mode that never repeats a number, with a clear error if you ask for more numbers than the range holds
  • Up to 1,000 numbers at once
  • Sort low to high, high to low, or keep draw order
  • Sum, average, smallest and largest statistics

Worked example

Minimum 1, maximum 49, quantity 6, unique on: a lottery-style draw such as 4, 11, 19, 27, 35, 42, with no repeats, guaranteed by the sampling method.

Frequently asked questions

Are these numbers really random?

They come from crypto.getRandomValues, your operating system's cryptographic random source, and the tool rejects biased samples, so results are uniform across the range.

Why did unique mode refuse my request?

A range from 1 to 10 holds only 10 unique numbers. Asking for 11 unique numbers is impossible, so the tool explains instead of looping forever.

Can I pick lottery numbers with it?

Yes, that is the classic use: set the range to your lottery's, quantity to the picks, and unique on. Every combination is equally likely, including yours.

What is the biggest range?

Any range your numbers fit in, and up to 1,000 results per generation.

Are the numbers really random?

They come from your browser's cryptographically secure random source, which is seeded from operating system entropy. For draws, games and sampling that is genuinely unpredictable. No online generator should be used to create encryption keys.

How do I pick a raffle winner fairly?

Number the entries from 1 to the total count, set that as the range, set count to 1 and duplicates off, then generate. The number drawn maps directly to the winning entry, and everyone can see the settings were fair.

Why do I sometimes get the same number twice in a row?

Because randomness includes repeats. With duplicates allowed, rolling the same value twice is as likely as any other pair. If repeats should be impossible, switch duplicates off and the generator samples without replacement.

What is the difference between random and pseudo random numbers?

True random numbers come from physical processes like electronic noise or mouse movement timing. Pseudo random numbers come from an algorithm that stretches a small random seed into a long unpredictable sequence. Browsers seed their cryptographic generator from operating system entropy, so the output you get here is pseudo random in construction but unpredictable in practice, which is what fair draws and sampling actually need.

Related tools

More Calculators and Generators like this one, plus two picks from other categories. Each opens its own dedicated page.

See all 100 tools
Copied