What is a random number generator used for?
Random numbers are essential in simulation, statistical sampling, game development, lotteries, A/B testing, and test data generation. This tool uses crypto.getRandomValues — the browser's cryptographically secure random source — rather than Math.random(), which is not suitable for scenarios requiring unpredictability. You can generate integers or decimals, enforce uniqueness across the batch, and sort the output.
How to use this tool
- 1 Set Min, Max, and Count. Leave decimals at 0 for integers.
- 2 Check "Unique values" to ensure no duplicates in the output.
- 3 Check "Sort ascending" to get the output in order.
- 4 Choose a separator and hit the regenerate button for a fresh batch.
Frequently asked questions
What is the range limit?
Min and Max can be any finite number the browser can represent as a float64. For integers, the practical range is ±2^53. For decimals, precision beyond about 15 significant digits is unreliable due to float64 representation.
What happens when I ask for more unique values than exist in the range?
The tool shows an error if you request more unique integers than the range [min, max] contains — for example, 10 unique values from a range of 1 to 5.
Is this cryptographically secure?
Yes — generation uses crypto.getRandomValues via a scaled mapping. For non-adversarial uses (test data, simulations) this is more than sufficient. For lottery or gambling applications, additional review of the full implementation is recommended.
Why does the separator choice matter?
Comma-separated output pastes directly into spreadsheet cells or array literals. Newline output works well for scripts or line-by-line processing. Space-separated works for inline use.
Is my output sent anywhere?
No. Everything runs locally in your browser.