Random number generator
Pick a random number between any two numbers, or thousands of them, with no repeats if you need. Both ends are included, and every number is equally likely.
runs in your browser · nothing uploaded
How to use it
- Set the range. Both numbers are included, so 1 to 10 can give 10.
- Set how many. Tick no repeats to draw like a raffle, where each number comes up once.
- Choose decimal places if you need fractions, and sort if you want them in order.
- Press Generate for a new draw.
Fair, not just random
A common mistake is taking a random value modulo the range size, which makes the low numbers slightly more likely whenever the range doesn't divide evenly. This page uses rejection sampling on the browser's cryptographically secure generator (crypto.getRandomValues), so every number in the range has exactly the same chance. It is suitable for prize draws, games and sampling.
Do it in code
Python: secrets.randbelow(100) + 1. Node.js: crypto.randomInt(1, 101), whose upper bound is exclusive. Java 17 or later: new SecureRandom().nextInt(1, 101). Go: rand.Int(rand.Reader, big.NewInt(100)) from crypto/rand, plus 1. PHP: random_int(1, 100). Ruby: SecureRandom.random_number(1..100). Bash: shuf -i 1-100 -n 1.
Each of those gives 1 to 100 with every value equally likely. We ran all seven 100,000 times on Linux and every one produced both 1 and 100 and nothing outside; the scripts and output are in examples/random-number in this site's repository. Avoid Math.random() and Bash's $RANDOM for anything that matters: neither is cryptographically secure, and $RANDOM % 100 is biased.
Questions
Is anything sent to a server?
No. Everything happens in your browser, and nothing you type is uploaded or stored by us.
Is this a true random number generator?
It uses your operating system's cryptographically secure generator, which mixes in hardware noise. That is what security software relies on, and for any draw or game it is indistinguishable from true randomness.
Can I use it for a giveaway?
Yes. For transparency, record your screen while you draw, or use the name picker with the list of entrants.