Numbers
Random Number Between X and Y
Used by developers, writers, and creators worldwide.
A random number between X and Y generator sounds simple, but the details matter. Set your own minimum and maximum — any integers, including negatives — choose how many numbers to draw, and toggle the no-duplicates option to ensure every result is distinct. Results appear instantly in the browser, no account needed. The tool produces whole integers only, which makes it the right choice when decimals break things: raffle draws, classroom lotteries, tabletop dice rolls, QA seed data. Whether you need one number or a batch of hundreds, a tight range like 1–6 or a wide one like 1–100,000, it handles both in a single click.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Set the From field to your desired minimum value (including 0 or negatives if needed).
- Set the To field to your desired maximum value, making sure it is higher than From.
- Enter how many random numbers you want in the How many field.
- Switch No duplicates to Yes if each number in the output must be unique.
- Click Generate, then copy the resulting list to use wherever you need it.
Use Cases
- •Drawing 50 unique raffle ticket numbers from a pool of 1–500 for a charity giveaway
- •Rolling D&D ability scores by setting the range to 1–20 and generating six numbers at once
- •Seeding a Postgres test table with random integer IDs across a defined range using bulk output
- •Randomly assigning anonymous student IDs between 1000 and 9999 for blind grading in a university course
- •Generating randomised bracket seedings for a 16-team fantasy sports tournament without duplicates
Tips
- →For lottery-style picks, set your range to the actual ticket pool (e.g. 1–49) and enable No duplicates before generating.
- →When stress-testing software, generate a large batch with duplicates allowed to ensure your code handles repeated values correctly.
- →For weighted outcomes, run multiple smaller draws — e.g. two separate 1–6 ranges to simulate two dice — rather than one wide range.
- →If your count equals the total integers in the range with No duplicates on, you get a full random shuffle of every number — useful for random ordering tasks.
- →Bookmark the page with your preferred range pre-filled in the URL if you reuse the same settings regularly for games or recurring draws.
FAQ
how do i generate unique random numbers with no repeats
Switch the No duplicates option to Yes before clicking Generate. The generator shuffles the full integer pool within your range and picks without replacement, so every result is guaranteed distinct. Keep in mind your count can't exceed the total integers available — you can't pull 15 unique numbers from a 1–10 range.
can i use negative numbers or zero as the minimum value
Yes. The From field accepts any integer, including negatives and zero. Set From to -50 and To to 50, for example, and the generator draws correctly from that range. All outputs are still whole numbers throughout.
is math.random good enough for a raffle or giveaway
For raffles, games, classroom draws, and most testing scenarios, JavaScript's Math.random() is statistically fair and unpredictable enough. It's a pseudo-random generator, not a cryptographic one, so avoid it for security-sensitive applications like key generation. For a charity raffle or a fantasy draft, it's perfectly appropriate.