Random Number Between 0 and 9

Generate a random whole number from 0 to 9, for picking a single digit.

Press Generate for a random number between 0 and 9, ends included.

Odds for numbers between 0 and 9

Possible numbers10
Chance of any one number1 in 10 (10.0%)
Average result over many picks4.5
Even / odd numbers5 even, 5 odd

Where a random digit helps

A random digit is what you need to build a PIN, a code or a test ID one digit at a time. Zero is included, so there are ten possible digits and each one comes up 10% of the time.

A single digit also makes a quick spot check. Pick a digit, then review every order number, invoice or record whose last digit matches it. On a long list of sequential numbers, each ending covers about a tenth of the entries.

Building a random code from digits

Set How many numbers to the length of your code and untick No repeats, since real codes can repeat digits. Every extra digit multiplies the number of possible codes by ten. Each digit is picked on its own, so a code like 1111 is exactly as likely as 5829.

DigitsPossible codesAll digits differContains a 7Two neighbors match
31,00072.0%27.1%19.0%
410,00050.4%34.4%27.1%
5100,00030.2%41.0%34.4%
61,000,00015.1%46.9%41.0%
8100,000,0001.8%57.0%52.2%

Leave No repeats ticked only if you need a code with no repeated digits, which cuts the 4-digit options from 10,000 to 5,040. Someone guessing a random 4-digit code has a 1 in 10,000 chance on each try, and a 6-digit code makes that 1 in 1,000,000.

Digits also build bigger random numbers. Read three digits as one number and you get 000 to 999, a thousand results with the same chance each, leading zeros included. That's how printed tables of random digits were used to sample from numbered lists: take as many digits as the largest number has, and skip any result that's too big. Need 1 to 1,000? Read 000 as 1,000. Four digits give 0000 to 9999, and so on.

Guess the number between 0 and 9

Playing higher or lower? Always guess the middle of the numbers that are left, and you'll never need more than 4 guesses for 0 to 9. Guessing at random without the hints takes 5.5 guesses on average, even if you never guess the same number twice.

Waiting for one digit

Chance of having seen itPicks needed
50%7
90%22
99%44

Half the time a chosen digit shows up within 7 picks. Going 44 picks without it happens less than once in a hundred tries.

Counting 1,000 results

Out of 1,000 picks with repeats allowed, each digit averages 100. Counts between 82 and 119 cover at least 95% of cases, so uneven totals are normal.

Three-digit draws: exact order or any order

Three-digit lottery games often take two kinds of bet: an exact-order match and an any-order match. An exact match is 1 in 1,000. In any order, three different digits (like 1-2-3) can be matched 6 ways (0.6%), a pair (like 1-1-2) 3 ways (0.3%), and a triple (like 7-7-7) just 1. Four digits work the same way. An exact match is 1 in 10,000, and four different digits can be matched in 24 orders.

Random decimals and 10% steps

Each digit can be a decimal place. Three picks read as 0.d1d2d3 give a random decimal from 0.000 to 0.999 in steps of 0.001. Two digits give 0.00 to 0.99, which works as a random percentage. Each extra digit makes the steps ten times finer. A single digit also splits odds into 10% steps: succeed on 0 to 2 for a 30% chance, or 0 to 6 for 70%.

How many digits a list needs

To draw from a numbered list with digits alone, read enough digits to cover the largest number and skip results that are too big. Zero counts as too big here, since lists start at 1:

List sizeDigits per drawDraws you can use
6160%
50250%
250325%
600360%
5,000450%

A list of 600 wastes 40% of its draws. A list of 50 wastes half. The generator skips that step: set the range to the list size and every pick counts.

Digits collide quickly, too. If five people each pick a random digit, two of them match 69.8% of the time. With ten people, a match is almost certain.

How the number is picked

Your browser's Web Crypto API supplies a 32-bit random value (4,294,967,296 possibilities). Dividing by 10 leaves 6 spare values that would tilt the odds toward the lowest 6 numbers, so the generator discards them and draws again (1 time in 715,827,883).

Frequently asked questions

Why does a random digit include 0?

Because digits run from 0 to 9. Leaving 0 out would give 9 options per digit instead of 10 and make a code easier to guess.

How likely is a random 4-digit PIN to repeat a digit?

49.6%. Only 5,040 of the 10,000 possible 4-digit PINs have four different digits.