Random Number Generator
Generate truly random integers within a range.
Perfect for lotteries, scientific sampling, giveaways, or just picking a number.
Settings
Result
How to Use This RNG
Our Random Number Generator (RNG) is designed to be flexible and secure. It uses your browser's cryptographic capabilities to ensure true unpredictability.
- Set the Range: Enter the minimum (start) and maximum (end) values. For example,
1to100. - Choose Quantity: Select how many numbers you need. You can generate a single number or a list of thousands.
- Options:
- No Duplicates: Ensures every number in the list is unique (useful for lotteries).
- Sort: Automatically orders the result (Ascending or Descending).
- Generate: Click the button and copy your results!
Common Use Cases
Contests & Raffles
Pick a request, ticket, or user ID at random to determine a fair winner.
Gaming
Simulate dice rolls (1-6), coin flips (0-1), or loot drop chances.
Statistics
Select random samples from a dataset for unbiased analysis.
Decisions
Can't decide? Assign options to numbers and let fate decide.
How to Generate Random Numbers in Code
Here is how to generate a random integer between min and max in popular languages.
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
// Max is exclusive, Min is inclusive
return Math.floor(Math.random() * (max - min)) + min;
}
console.log(getRandomInt(1, 100));import random
# Return a random integer N such that a <= N <= b
random_number = random.randint(1, 100)
print(random_number)// Cryptographically secure random integer
$secureRandom = random_int(1, 100);
echo $secureRandom;import java.util.concurrent.ThreadLocalRandom;
// Random int between 1 (inclusive) and 101 (exclusive)
int n = ThreadLocalRandom.current().nextInt(1, 101);
System.out.println(n);Random rnd = new Random();
// 1 <= month < 13
int month = rnd.Next(1, 13);
Console.WriteLine(month);Frequently Asked Questions
Are these numbers truly random?
We use crypto.getRandomValues() where possible, which is cryptographically strong. This means the patterns are unpredictable enough for security applications, unlike the older Math.random().
Can I pick a winner for my Instagram contest?
Yes. If you have 500 comments, set the range 1-500, generate a number, and count down to see who matches that number.
Can I output decimals?
This tool is strictly for Integers (whole numbers). If you want decimals (e.g., 0.523), you can generate a large integer (1-1000) and divide by 1000 yourself.