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.
How to use
- Enter a minimum and maximum value (negative numbers and decimals are fine), then set how many numbers you need (up to 10000).
- Duplicates are off by default, so every result is unique. Tick "Allow duplicates" if equal outcomes are acceptable.
- Pick "Integer" or "Decimal"; for decimals you can also choose 1–6 decimal places.
- 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?
Why am I told that not enough unique numbers are available?
What is the maximum number of results per batch?
How to use
- 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.
- 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.
- 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.
- 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.
- 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
- 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.
- 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.
- 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.