Random Number Generator

Generate random numbers in any range.

Latest number
-
Set your range and generate.
Batch output

How to use

  1. Set the minimum and maximum values for the range you want.
  2. Choose integer or decimal output and pick the number of values to generate.
  3. Tick the Unique option if you do not want repeats in a single batch.
  4. Press Generate and the results appear instantly.
  5. Copy the output as a comma list or one number per line.

Frequently asked questions

How random is this generator?

It uses the Web Crypto API's crypto.getRandomValues, which produces cryptographically strong random numbers. That is far stronger than the Math.random() used by basic generators.

What is the maximum range?

Integers can span the full safe integer range, roughly negative to positive 9 quadrillion. Decimals are limited by JavaScript's double precision, about 15 significant digits.

Can I generate non-repeating numbers for a raffle?

Yes. Enable the Unique toggle and the generator returns distinct values in your range. Note that the number of unique values requested cannot exceed the size of the range.

Are the numbers seeded?

No. Each generation is fresh and unpredictable because the cryptographic random source has no observable seed.

Where computer randomness comes from

Computers are deterministic, so "random" numbers come in two grades. Pseudo-random generators (PRNGs) expand a seed into a long sequence that passes statistical tests but is fully reproducible from the seed... ideal for simulations and games, where reproducibility is a feature. Cryptographically secure generators (CSPRNGs, like the browser's crypto.getRandomValues) mix in hardware entropy so that the next value is unpredictable even to someone who has seen all previous values... required for anything adversarial: passwords, tokens, lottery draws with money attached.

Subtleties that produce biased results

  • Range boundaries: be explicit about inclusivity. "1 to 100" should produce both 1 and 100; off-by-one range bugs are the most common randomness defect in homemade code.
  • Modulo bias: mapping a generator's output into a range with a naive remainder operation slightly favours low numbers unless the implementation compensates.
  • Duplicates are legitimate: in 25 draws from 1-100, repeats are more likely than not. If you need unique values, use without-replacement drawing, which is a different operation.
  • Humans cannot do this in their heads: asked for "random" numbers, people avoid repeats, avoid round numbers and over-select 7... real randomness looks less random than people expect.

Fair selection in practice

For a giveaway with 312 entries: number the entries in a published order, generate one number in 1-312, and announce both the ordering and the result. The published procedure, fixed before the draw, is what makes the outcome auditable... the randomness is necessary but the pre-commitment is what makes it fair.

Sampling patterns for common tasks

  • Pick one of N: a single draw from 1 to N, the basic case.
  • Pick several distinct winners: draw without replacement (or shuffle and take the top k)... never repeated independent draws, which can select the same entry twice.
  • Random pairing: shuffle once and pair consecutive entries; drawing pairs one at a time biases the late picks.
  • Weighted choice (entries with multiple tickets): expand each entry by its ticket count, then draw once from the expanded range.
  • Spot-check sampling for QA: generate k positions across the dataset rather than "picking a few"... humans sample the start, the end, and whatever looks interesting, which is the opposite of a sample.

Advertisement