Random number between 1 and 8

Press Generate for a random whole number from 1 to 8, inclusive. There are 8 possible results, so each has a 1 in 8 chance (12.5%).

Probability facts for 1–8

QuestionAnswer
Chance of one specific number1 in 8 (12.5%)
Chance of an even number4 of 8 = 50%
Chance of a prime number4 primes = 50%
Average result (expected value)4.5
Standard deviation2.29
Chance a given number shows up at least once in 10 picks73.7%
Chance of at least one repeat in 5 picks79.5%
Picks needed for a 50% chance of a repeat4
Average picks to see every number at least once22

How it works

The generator draws a uniform random integer from 0 to 7 with crypto.getRandomValues and adds 1. Rejection sampling removes the small bias that the plain “random modulo 8” trick would cause.

The repeat surprise

Duplicates come sooner than intuition suggests. With 8 possible values, 4 picks already give a better-than-even chance that two match — the same maths as the birthday problem. Tick “No repeats” if you need distinct numbers.

Every outcome

NumberProbability
112.5% (1/8)
212.5% (1/8)
312.5% (1/8)
412.5% (1/8)
512.5% (1/8)
612.5% (1/8)
712.5% (1/8)
812.5% (1/8)

Similar ranges

Frequently asked questions

What is the chance of guessing a number between 1 and 8?
1 in 8, or 12.5% per guess.
Can the same number come up twice in a row?
Yes. Each pick is independent, so the chance of an immediate repeat is 1 in 8.