Random Number Generator

Generate random integers or decimals in any range, in batches with optional uniqueness. Numbers come from the browser's cryptographically secure random source, so everything is generated locally and instantly.

By default results are unique. For decimals, uniqueness is judged at the selected precision. The maximum count is 10000: generate in batches for more.

How to use

  1. Enter a minimum and maximum value (negative numbers and decimals are fine), then set how many numbers you need (up to 10000).
  2. Duplicates are off by default, so every result is unique. Tick "Allow duplicates" if equal outcomes are acceptable.
  3. Pick "Integer" or "Decimal"; for decimals you can also choose 1–6 decimal places.
  4. Click "Generate" to see the results, then "Copy all" to copy the whole list at once, or "Clear" to start over.

FAQ

Are the numbers truly random?
Yes: values are produced with crypto.getRandomValues(), the browser's cryptographically secure random source, which is far stronger than plain Math.random(). Generation happens entirely on your device with no server involved.
Why am I told that not enough unique numbers are available?
When duplicates are disabled every result must differ, so the count cannot exceed the number of distinct values inside the range (integers within the interval, or decimals distinguishable at the chosen precision). Widen the range, reduce the precision, or enable duplicates to fix it.
What is the maximum number of results per batch?
The per-batch limit is 10000 to keep the page responsive. If you need more, generate several batches with adjusted parameters or switch to allowing duplicates.

How to use

  1. Set the range

    Enter Minimum and Maximum values; negatives and decimals are allowed, for example -5 to 5 or 0 to 1. Boundary values themselves can be drawn.

  2. Pick count and type

    Set Count between 1 and 10000. Choose Integer for whole numbers, or Decimal and then a precision of 1-6 decimal places.

  3. Decide on duplicates

    By default every result is unique. Tick Allow duplicates when equal values are acceptable, such as simulating repeated draws or sampling with replacement.

  4. Generate and copy

    Click Generate to fill the output list, then Copy all to grab every number at once. Paste the result straight into a spreadsheet or code. Clear resets everything.

  5. Fix a not-enough-unique error

    If you are told unique values ran out, the range cannot supply that many distinct results. Widen the range, lower the decimal precision, or allow duplicates.

About this tool

This generator draws integers or decimals in any range, up to 10000 per batch, unique by default with an opt-in for duplicates. Values come from crypto.getRandomValues(), the browser's cryptographically secure random source, far less predictable than plain Math.random(). That is reliable enough for draws, sampling and games. Every batch is produced instantly, and no data leaves your device.

It fits classroom name picking, prize draws, survey sampling, tabletop randomness and test data. Set a range and a count and get results in one click instead of writing a script. Decimal mode with 1-6 places of precision is handy for simulated measurements or probability samples. Everything is computed on your device, so teachers can share the screen and reroll live in front of the class.

How it works

Mapping a random 32-bit integer onto an arbitrary range has a classic trap. When the range does not divide 2^32 evenly, plain modulo makes the lowest values slightly more likely. The fix is rejection sampling: discard draws that fall in the leftover band and redraw. This tool does exactly that, so every value in the range is exactly as probable as any other. For casual games the bias would be too small to notice, but prize allocation deserves the strict version. Draws, name-picking and raffles are precisely the settings where equal probability must survive a public audit.

Unique mode is sampling without replacement. Every draw shrinks the pool, and as the request approaches the range's capacity the candidates thin out, which is when the not-enough-unique warning fires. Ticking Allow duplicates switches to sampling with replacement, the right model for dice-like events. Decimal mode deduplicates at the chosen precision: at two places, 0.10 and 0.1 are one value. Each extra decimal place enlarges the usable space roughly tenfold. When the warning appears, work out the capacity first, then choose between precision and duplicates.

When to use it

  1. Classroom picking and grouping

    Set the range to student numbers and draw a unique batch for questions or group work. Every student is exactly equally likely, and the draw replaces fumbling with paper slips or shuffling cards.

  2. Transparent prize draws

    Draw winners from contestant numbers with duplicates off so nobody wins twice. Everything is computed locally, so the mapping from number to winner can be replayed and verified on the spot.

  3. Fixtures and simulations

    Two-decimal draws from 0 to 1 simulate probabilities for unit tests, and negative ranges exercise error handling for invalid input. Survey respondent IDs can be bulk-generated without writing a throwaway script.

Tips & tricks

  • In unique mode the count cannot exceed the distinct values available in the range, or the tool will report a shortfall.
  • Decimal uniqueness is judged at the chosen precision: at two places, 0.10 and 0.1 count as the same result.
  • One batch caps at 10000 numbers. For more, adjust the range or click Generate again for a fresh batch.

Things to watch

  • Boundaries are included

    Both Minimum and Maximum themselves can be drawn. If those numbers are reserved or void in a raffle, narrow the range to valid IDs first. The tool will not exclude them for you.

  • Precision limits unique space

    Two decimal places over 0-1 offer only 101 distinct values, so requesting 200 unique results must fail. When the warning appears, count the range's capacity before choosing between precision and duplicates.

  • Secure randomness is not reproducible

    crypto.getRandomValues() exposes no seed, so a batch cannot be replayed later. If an experiment must be reproducible, use a seeded generator elsewhere and copy these results out immediately.

Related Tools