Random Number Generator
Generate one or many random whole numbers in any range, with or without repeats, using your browser's secure random generator.
How to use this calculator
Enter the lowest and highest numbers you want (both are included), how many numbers to draw and whether a number may appear more than once. Click Calculate again for a new draw. Numbers come from the Web Crypto random generator built into your browser and are not stored or sent anywhere.
Formula
Each number is drawn uniformly from the whole numbers min…max using crypto.getRandomValues with rejection sampling, so every value has exactly the same probability. Without repeats, numbers are drawn as a partial Fisher–Yates shuffle.
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
Are these numbers truly random?
They come from a cryptographically secure pseudorandom generator seeded by your device's operating system, which is suitable for draws, games and sampling.
Can I use it for a raffle or giveaway?
Yes. Number the entries, set the range to match and draw as many winners as needed with repeats switched off.
Is the minimum and maximum included?
Yes. A range of 1 to 6 can return 1, 2, 3, 4, 5 or 6, like a die.
Can it pick decimals?
This tool draws whole numbers. For decimals, scale up: to pick from 0.00 to 1.00, draw from 0 to 100 and divide by 100.
How many numbers can I generate?
Up to 1,000 at a time. Without repeats, you cannot draw more numbers than the range contains.
What are the odds of each number?
Every number in the range is equally likely: 1 divided by the size of the range.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- World Wide Web Consortium. (n.d.). Web Cryptography API: Crypto.getRandomValues (Editor's draft). View source
- Knuth, D. E. (1997). The art of computer programming: Vol. 2. Seminumerical algorithms (3rd ed.), Section 4.1: Positional number systems. Addison-Wesley. View source
- Ross, S. M. (2019). A first course in probability (10th ed.). Pearson. View source
- Croarkin, C., & Tobias, P. (Eds.). (2012). NIST/SEMATECH e-handbook of statistical methods. National Institute of Standards and Technology. View source