3tej home
← Utilities

What is Random Number Generator?

A Random Number Generator produces a random number on demand, using a deterministic algorithm or a cryptographically strong random source. Output is generated entirely in your browser so nothing is sent to a server. Generate single random numbers or lists within a custom range.

Interactive generator

Random number generator

Cryptographically random integers in any range.

-

Random Number Generator

Cryptographically secure random integers in any range. Single value or list.

About this tool

The Random Number Generator produces single random numbers or lists within your specified range. Uses cryptographically secure randomness via the Web Crypto API. Shows basic statistics (min, max, mean) for generated lists.

About this random number generator

A random number generator (RNG) returns one or more integers drawn uniformly from a closed interval [min, max]. The generator on this page draws from the browser's cryptographic entropy pool (Web Crypto API), so each draw is independent of the previous one and unpredictable to anyone who did not observe the operating system seed. Practical uses include picking a giveaway winner, choosing a row in a spreadsheet for spot-checking, randomizing test data, deciding turn order in a board game, seeding a Monte Carlo simulation, sampling participants for a research study, or just settling an argument without flipping a coin.

Two settings control what you get back: range (min and max) and count. A third toggle, "Allow duplicates," decides whether the draw is with replacement (a duplicate can appear) or without (every number in the output list is unique). Without-replacement draws are equivalent to shuffling a deck and dealing the top N cards, which is what you want for raffle winners or selecting employees for an audit.

How the generator works

Under the hood the page calls crypto.getRandomValues(new Uint32Array(1)) to fetch a 32-bit unsigned integer between 0 and 4,294,967,295, then maps it into the target range using min + (raw % range). For ranges smaller than 2^31 this introduces a tiny modulo bias on the largest residues, undetectable in typical uses; for cryptographic randomness in giant ranges, a rejection-sampling loop would be the textbook fix. The draw repeats until the requested count is reached, with a seen-value map skipping repeats when duplicates are disallowed.

range  = max - min + 1
draw   = min + (crypto32() mod range)
unique = draw and seen[draw] == 0
output = [draw1, draw2, ..., drawN]
  • crypto32() = one 32-bit value from crypto.getRandomValues, seeded by the OS entropy pool.
  • range = the inclusive count of integers between min and max.
  • seen = a hash set that prevents repeats when Allow duplicates is off.

Worked example: pick 5 raffle winners

You run a giveaway with 240 valid entries. Set min = 1, max = 240, count = 5, Allow duplicates off. Click Regenerate. The generator returns five unique integers (for example 73, 12, 198, 207, 41). Match each integer to the row number in your entry spreadsheet to find the winners.

  1. Range size: 240 minus 1 plus 1 = 240 unique integers in the pool.
  2. Without-replacement draw: the first integer has 240 possibilities, the second has 239, and so on.
  3. Probability any specific entry wins: 5 divided by 240 = 2.08 percent.
  4. Audit trail: screenshot the output and post it publicly so participants can verify their row number.
Result: Five fair, independent picks from 240 entries, drawn in under a millisecond, with no row eligible to win twice.

Common use cases and recommended settings

Use caseMinMaxCountDuplicates
Coin flip011On
Six-sided dice161 or NOn
Pick a row in a 1000-row sheet110001On
5 raffle winners from 240 entries12405Off
Lottery-style 6 of 491496Off
Shuffle 30 students into pairs13030Off
Monte Carlo seed021474836471On

Pitfalls to avoid

  • Using Math.random for security work. Math.random is a non-cryptographic PRNG (xorshift128+ in V8); attackers can predict its sequence. This tool uses Web Crypto, but if you copy the code, keep the crypto path.
  • Confusing without-replacement count caps. If you want 10 unique numbers from 1 to 5, no algorithm can deliver: the range only has 5 integers. The tool surfaces "count exceeds unique range" instead of looping forever.
  • Expecting evenly spread results. True randomness is clumpy. Drawing 10 numbers from 1 to 100 often shows two close neighbors and a gap; this is correct uniform behavior, not a bug.
  • Re-rolling until you like the result. Each click is fair, but cherry-picking the third roll because you preferred it makes the draw biased and indefensible to anyone who challenges it.
  • Forgetting to record the seed for audits. Web Crypto does not expose a seed, so you cannot reproduce a draw. For audit-grade raffles, use a server-side RNG that publishes a hash of the seed in advance.
  • Treating small samples as proof of bias. If you draw 1 to 6 ten times and never get a 4, that is normal variance. Run 600 draws and the distribution will flatten.

Related tools on 3Tej

Frequently asked questions

Is this generator truly random or just pseudo-random?

It uses the Web Crypto API's crypto.getRandomValues, which returns cryptographically secure pseudo-random numbers (CSPRNG) seeded by the operating system's entropy pool. That is the same primitive browsers use for HTTPS session keys. It is not Math.random, which is a non-cryptographic algorithm not safe for security purposes.

Why does the generator say count exceeds unique range?

When Allow duplicates is unchecked, the count cannot be larger than the size of the range. Range size equals max minus min plus 1. For example, 1 to 10 has 10 unique integers, so the count cap is 10. Increase the range, lower the count, or allow duplicates.

Are these numbers safe to use for a giveaway or raffle drawing?

Yes for low-stakes draws like Instagram giveaways, classroom lottery picks, podcast contests, or team-name shuffles. For regulated gambling, lottery, or legal sweepstakes, you typically need a third-party auditable RNG with a published seed and verification certificate. This tool does not produce a verifiable certificate.

Why are the same numbers repeating in my list?

You likely have Allow duplicates on. In a uniform random draw, duplicates are normal and expected: drawing 10 numbers from 1 to 100 has a 37 percent chance of at least one repeat (birthday paradox math). Turn off duplicates to draw without replacement.

What is the maximum range and count this generator supports?

The generator handles integer ranges up to JavaScript's safe-integer limit (2^53 minus 1) per side and counts up to 500 numbers in one draw. For very large lists or 64-bit ranges, you would need server-side BigInt handling. Most contest, classroom, and quick-decision uses fit comfortably inside the default 1 to 100 range.

Last updated 2026-05-28.

IT
India Tools Editorial
Calculators & explainers maintained by the India Tools team.