Random Number Generator
Generate secure random numbers in any range: whole numbers or decimals, with or without duplicates, sorted or shuffled. Up to 10,000 at once, in your browser.
0 = whole numbers
What is Random Number Generator?
This tool draws random numbers between a Minimum and a Maximum you choose. It can produce whole numbers or numbers with up to 10 decimal places, avoid duplicates, sort the result and output up to 10,000 values at once. The randomness comes from your browser's cryptographically secure generator, not from Math.random().
How to use Random Number Generator
- Enter the Minimum and Maximum (both are included in the range).
- Set How many numbers you need and the number of Decimal places (0 for whole numbers).
- Tick No duplicates if every number must be different, and choose a Sort order and Separator.
- Click Generate, then copy the list or download it as a text file.
Example
Minimum 1, Maximum 49, How many 6, No duplicates, Sort ascending
16 19 27 40 44 48
Values are random, so your result will differ.
When to use Random Number Generator
Use it for raffles and giveaways, picking test samples, classroom exercises, games, or any time you need fair, unpredictable numbers. It is not a replacement for a certified random number generator in regulated gambling, and for passwords or keys use a dedicated password or secret-key generator instead.
How Random Number Generator works
Random bytes come from crypto.getRandomValues. To pick a value in a range of size *n* the tool uses rejection sampling: it draws a 32-bit (or 53-bit) integer and discards values above the largest multiple of *n*, so every number in the range has exactly the same probability (no modulo bias). Decimals are produced by drawing an integer on a grid of step 10^-d and dividing, so 0 to 1 with 2 decimals gives one of the 101 values 0.00 … 1.00 with equal chance. Unique numbers use Robert Floyd's sampling algorithm, which picks *k* distinct values in *k* steps without building the whole range, and are then shuffled with Fisher–Yates.
Common Use Cases
- Drawing winners for a giveaway by numbering the entries
- Picking 6 unique lottery-style numbers from 1 to 49
- Generating random IDs or sample sizes for a test dataset
- Choosing random decimal values (e.g. 0.00–1.00) for simulations
- Assigning students or players to random positions
FAQs
Are the numbers truly random?
They come from the operating system's cryptographically secure random number generator via crypto.getRandomValues, which is unpredictable and suitable for security purposes. Rejection sampling removes the bias that a simple modulo would introduce.
Are the minimum and maximum included?
Yes. With Minimum 1 and Maximum 6 every value from 1 to 6 can appear, like a die.
Why do I get an error with "No duplicates"?
A range only contains a limited number of distinct values. For example 1–10 has 10 values, so you cannot get 11 unique numbers from it. Widen the range, add decimal places or lower the count.
Can I generate negative numbers?
Yes. Use a negative Minimum, e.g. -50 to 50.