Generate random integers within a custom range. Pick how many numbers you need, set the minimum and maximum, and optionally require that all values are unique — perfect for lotteries, sampling, games, and testing.
Generated output
Set your range and count, then click Generate.
How it works
The generator fills a Uint32Array with cryptographically random values using crypto.getRandomValues, then maps each value into your chosen range using the modulo operator. For unique values, it builds a pool of all integers in the range and performs a Fisher-Yates shuffle using crypto randomness, then takes the first n values from the shuffled pool. This guarantees no duplicates while maintaining uniform randomness.
Practical example
You are running a prize draw and need to pick 6 unique winners from 50 participants. Set min to 1, max to 50, count to 6, and enable unique values. The generator returns 6 distinct numbers — for example, 3, 17, 29, 42, 48, 11 — which correspond to your participant list entries.
Frequently asked questions
Answers to common questions about this generator and how it works.
Is this truly random?
The generator uses crypto.getRandomValues, which is a cryptographically secure pseudo-random number generator (CSPRNG) built into your browser. It produces statistically unbiased output suitable for use in security-sensitive and statistical applications.
What does "unique values only" mean?
With unique values enabled, no number will appear more than once in the results. This is useful for lotteries, random sampling, card draws, and any scenario where you need each value to be distinct. Note: the count cannot exceed the total range size.
Can I generate floating-point numbers?
This generator produces integers (whole numbers) only. For floating-point results, multiply an integer result by a decimal factor in your own code after generation.
Can I generate negative numbers?
Yes. Set your minimum to a negative value (for example, min -50, max 50) and the generator will include negative integers in the range.
What is the maximum count I can generate?
A maximum of 50 numbers per generation. For larger datasets, run the generator multiple times and combine the results.
Related generators
Explore other generators that pair well with this one.
UUID Generator
Generate v4 UUIDs for databases, APIs, and distributed systems.
Password Generator
Generate strong, unique passwords with custom length and character sets.