How do I generate a random number?
A random integer generator for any min-max range. You can generate one number or up to 1000 at once, optionally without duplicates and pre-sorted.
Under the hood it uses the Web Crypto API: the real randomness used in security, not the basic `Math.random`. That makes the results genuinely unpredictable, suitable for raffles, games, statistics.
How to use it
- Set min and max: the range (inclusive on both ends).
- Enter the count of numbers to generate (1-1000).
- Unique (toggle), forces every result to be different. Requires a range larger than the count.
- Sorted (toggle), orders the result from smallest to largest.
- Click "Generate": results show as tiles. "Copy" saves them as a comma-separated list.
When this is useful
The most common uses:
- Picking a contest winner: 100 people entered, pick 1. Range 1-100, count 1, click "Generate". Add "unique" if you draw multiple places (e.g. 3 of 100).
- Lottery-style numbers: 6 unique sorted numbers from 1-49 = classic lottery picks. Enable both "unique" and "sorted".
- Dice roll: range 1-6, count 1. Or two dice, range 1-6, count 2.
- "Which movie tonight?": number the list, draw a number. Discussion over.
- Test data for software: a thousand unique IDs from 1-9999 for a database test. Tick "unique", count 1000.
- Education, statistics and probability: generate 100 dice rolls and check whether the distribution is even. Useful for teaching the law of large numbers.
- Everyday decisions: "coffee or tea?" → range 0-1. "Restaurant A, B, or C?" → range 1-3.