Random Number Generator
Generate random numbers.
Loading tool…
About this tool
Set a minimum and a maximum, then press Generate. You get one random whole number between them, inclusive of both ends.
How to use
1
Step 1
Enter the Min and Max.
2
Step 2
Press Generate.
3
Step 3
Press again for another number; recent results appear below.
How it works
The number comes from crypto.getRandomValues, the browser's cryptographic random source, scaled to the range. If you enter Min larger than Max the two are swapped. Each press is independent, so numbers can repeat.
range size = max − min + 1
Worked example
A dice-like range
- Input
- Min 1, Max 6
- Output
- an integer from 1 to 6, each with probability 1/6
- Walkthrough
- The range contains 6 − 1 + 1 = 6 numbers, all equally likely.
Limitations
- Whole numbers only.
- One number per press, with replacement.
- Not audited for lotteries or gambling.
Questions
How do I generate a random number between 1 and 100?
Leave Min at 1 and Max at 100 and press Generate.
Are both ends included?
Yes. Both the minimum and the maximum can be returned.
Is it truly random?
It uses the browser's cryptographic generator, which is suitable for everyday draws.
Can I generate decimals?
No, only whole numbers.
Features
- Inclusive range
- Cryptographic random source
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Reduce image size with srcset
Chrome for Developers
Asset prep often sits next to timers in maker workflows.
Watch on YouTubeHTML in 100 Seconds
Fireship
Lightweight web apps power many productivity helpers.
Watch on YouTube
- Work stress overview
APA
Breaks and pacing context for productivity timers.
- setTimeout()
MDN
How browser timers work under countdown UIs.