Generate random numbers in any range
Need a number between 1 and 100, six lottery numbers, or a list of 1,000 random values for a test? This random number generator picks numbers in any range you choose, with options for no duplicates, sorting and decimal places. It uses your browser's cryptographically secure randomness, so results are unpredictable and evenly distributed, and nothing is sent to a server.
Features
- Any range, including negative numbers and very large values.
- One or many: generate up to 10,000 numbers in one click.
- No duplicates mode that draws numbers like balls from a bag, efficiently even for huge ranges.
- Decimal numbers with up to six decimal places.
- Sort results in ascending order and copy them as a list.
- Unbiased: rejection sampling ensures each value in the range is equally likely.
Popular uses
Games and decisions. Roll a virtual die (1–6), pick who goes first, choose a random page or question, or settle a decision fairly.
Raffles and giveaways. Assign each entry a number, then draw winners without duplicates. Because the randomness comes from a secure source, no one can predict or influence the result.
Lotteries. Generate a set of unique numbers for lottery tickets. Random choices avoid popular patterns like birthdays, which means you are less likely to share a prize.
Education and research. Select random samples from a numbered list, assign participants to groups, or create practice exercises.
Software testing. Generate test inputs, IDs or sample datasets in a specific range.
How "fair" random numbers are produced
A naive approach takes a large random value and uses the remainder after dividing by the size of the range. That subtly favours some numbers whenever the range does not divide evenly into the random source. This tool instead discards values that would cause bias and draws again ("rejection sampling"), so a range of 1–3 gives each number exactly a one-in-three chance.
For unique draws, the tool performs a partial Fisher–Yates shuffle: conceptually it shuffles the whole range and takes the first numbers, but without ever building the full list, so drawing 10 numbers from 1 to 1,000,000,000 is instant.
If you need random text instead of numbers, try the Password Generator or the UUID Generator.