Random number generator

What is a Random Number Generator?

Random numbers are needed for raffles and giveaways, picking a winner, sampling records for an audit, assigning test groups, games and simulations. This generator produces numbers within a range you choose, one at a time or in bulk, with an option to avoid duplicates.

How to use it

  1. Enter the minimum and maximum values.
  2. Choose how many numbers to generate.
  3. Tick unique values if no number should appear twice.
  4. Generate and copy the results.

Examples

  • Pick a raffle winner from tickets 1 to 500: one number between 1 and 500.
  • Lottery-style draw: 6 unique numbers between 1 and 49.
  • Audit sample: 20 unique row numbers between 2 and 10,001 to check spreadsheet records.
  • A/B testing: random 0 or 1 assignment for each user.

How randomness is produced

Numbers are drawn with the browser's cryptographically secure generator, crypto.getRandomValues, rather than Math.random. Each value in the range is equally likely and results cannot be predicted from previous ones. Mapping random bytes to a range is done without modulo bias, which would otherwise make some numbers slightly more common.

Things to know

  • Unique values require the range to contain at least as many numbers as you ask for.
  • Inclusive range: both the minimum and the maximum can be drawn.
  • Randomness is streaky. Repeats and runs are normal in random data and not a sign of bias.
  • For public draws, record the settings and result, or use a witnessed process, so the outcome can be trusted.

Frequently Asked Questions

Are the numbers truly random?

They come from the browser's cryptographically secure random number generator, which is suitable for draws and security purposes.

Are the minimum and maximum included?

Yes. Both ends of the range can be selected.

How do I generate numbers without repeats?

Enable the unique option. The range must contain at least as many values as you request.

Why did the same number come up twice?

Without the unique option, each draw is independent, so repeats are expected and normal.