The direct answer: a random 2-digit number is any integer from 10 to 99, inclusive. To generate one yourself, use a calculator, a spreadsheet function, or a simple mental trick—each method is explained below.
What Counts as a 2-Digit Number
A 2-digit number has exactly two digits, meaning it falls between 10 and 99. The number 09 is not a 2-digit number in standard math because leading zeros are not counted; 9 is a single-digit number. However, in some contexts like PIN codes or lottery draws, “09” might be written with a leading zero, but mathematically it is still 9. For this article, a random 2-digit number means an integer from 10 to 99, giving 90 possible outcomes.
How to Generate a Random 2-Digit Number Manually
If you need a random 2-digit number without any tools, you can use a simple method: pick a random digit from 1 to 9 for the tens place, and a random digit from 0 to 9 for the ones place. For example, if you think of a digit between 1 and 9 (say, 7) and another between 0 and 9 (say, 3), you get 73. This works because the tens digit cannot be 0 (otherwise it would be a 1-digit number).
For a more uniform approach, you can use a physical randomizer like a die. Roll a 10-sided die (if you have one) twice—first for the tens digit (1-9, rerolling a 0) and then for the ones digit (0-9). Or roll a standard 6-sided die twice and map the results: for instance, roll a die for the tens place (1-6) and another for the ones place (1-6), giving numbers from 11 to 66, but that only covers 36 of the 90 possibilities. To cover all 90, you need a method that gives equal probability to every number from 10 to 99.
Using a Calculator or Phone
Most scientific calculators have a random number function, often labeled RAN# or RAND. It gives a decimal between 0 and 1. Multiply that by 90 (the number of possible 2-digit numbers), add 10 (the minimum), and then take the integer part. For example, if your calculator shows 0.4567, then 0.4567 × 90 = 41.103, plus 10 = 51.103, so the integer part is 51. This gives a number from 10 to 99.
On a phone, you can use a dedicated random number generator app or ask a voice assistant like Siri or Google Assistant: “Hey Siri, give me a random number between 10 and 99.” These use built-in algorithms to produce a uniform result.
Generating in Excel or Google Sheets
In Microsoft Excel (Microsoft 365 for Windows), the easiest formula is:
With any cell selected, type: =RANDBETWEEN(10,99) and press Enter. This returns a random integer between 10 and 99, inclusive. Every time the sheet recalculates (e.g., when you press F9 or edit another cell), it will give a new number.
If you want a decimal 2-digit number (like 45.67), use: =RAND()*90+10. This gives a random decimal from 10 to 99.999… but not including 100. To round to two decimal places, use: =ROUND(RAND()*90+10,2).
In Google Sheets, the same functions work: =RANDBETWEEN(10,99) and =RAND(). The only difference is that Google Sheets recalculates on every change or when you refresh the page, whereas Excel recalculates on command or when the workbook changes.
For a list of multiple random 2-digit numbers, in Excel you can copy the formula down a column. In Google Sheets, you can use =ARRAYFORMULA(RANDBETWEEN(10,99)) but that only works for a single cell; to fill a range, select the range and enter the formula with Ctrl+Shift+Enter (in Excel) or just type it in the first cell and drag the fill handle.
Common Problems and Misconceptions
One common mistake is thinking that a random 2-digit number includes 00 or 99. It does not include 00 because that is not a 2-digit number (it’s just 0). It does include 99, which is the largest 2-digit number. Another misconception is that “random” means “no repeats.” In a true random sequence, repeats are possible and even expected. For example, generating 10 random 2-digit numbers might produce 42 twice—that’s normal.
Another issue is bias. If you ask a human to pick a random number, they tend to choose numbers like 37 or 73, avoiding numbers with repeated digits (11, 22, 33) and numbers ending in 0. This is a well-known psychological bias, but it is not truly random. For unbiased randomness, use a computer or a physical randomizer.
How to Choose a Random 2-Digit Number for a Specific Purpose
If you need a random 2-digit number for a lottery, a game, or a statistical sample, the method matters. For a lottery where each number has equal chance, use a uniform random generator like RANDBETWEEN. For a game where you want to avoid repeats, you might use a shuffle method: list all numbers from 10 to 99, shuffle them, and pick the first few. In Excel, you can use the RAND function to assign a random decimal to each number, then sort by that decimal.
For cryptography or security purposes, you should use a cryptographically secure random number generator, not a simple spreadsheet function. For example, in programming, use random.SystemRandom in Python or crypto.getRandomValues in JavaScript. Spreadsheet RAND is not secure enough for passwords or tokens.
Alternatives to Generating Your Own
If you don’t want to calculate, there are many free online random number generators. Websites like random.org use atmospheric noise to generate truly random numbers, which is better than pseudo-random algorithms. You can also use a physical method: draw numbered balls from a bag, use a deck of cards (assign each card a number), or use a stopwatch and take the last two digits of the time (though this is not uniformly random).
For a quick mental trick, you can use the current time: take the seconds value (0-59) and add 10 to get a number from 10 to 69, but that is not uniform and only covers 60 numbers. A better mental trick is to think of a two-digit number and then reverse it, but that introduces bias.
Frequently Asked Questions
Can a random 2-digit number be 00?
No. 00 is not a 2-digit number because leading zeros are not counted. The smallest 2-digit number is 10, and the largest is 99.
How do I generate a random 2-digit number in Python?
In Python, use the random module: import random; print(random.randint(10, 99)). This gives an integer from 10 to 99 inclusive. For a secure version, use secrets.randbelow(90)+10.
Is there a difference between random and pseudo-random?
Yes. True random numbers come from physical processes like radioactive decay or atmospheric noise. Pseudo-random numbers are generated by algorithms and are deterministic—given the same seed, they produce the same sequence. For most everyday uses, pseudo-random is fine, but for security, use true random or a cryptographic generator.
What is the probability of getting a specific 2-digit number like 42?
Since there are 90 possible 2-digit numbers (10-99), the probability of getting any specific number is 1 in 90, or about 1.11%. This assumes a uniform random generator.
Can I use a random 2-digit number for a password?
It is not recommended. A 2-digit number has only 90 possibilities, which is trivially easy to guess. For a password, use a longer random string with letters, numbers, and symbols. If you need a numeric PIN, use at least 6 digits.
Related
- How Much Coding for Data Security?
- Google Sheets Query Sum: Formula & Examples
- Shortcut for Searching in Excel? Ctrl+F and More
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Button Cell Battery Components: What’s InsideA button cell battery is a small, disc-shaped battery made of a metal can (the positive terminal), a…
- How to Get Out of Replace Mode in Excel and Restore TypingTo get out of Overtype (replace) mode in Excel for Microsoft 365 on Windows, click inside the cell…
- Excel Slicer Examples: PivotTables, Tables, and TipsExcel slicer examples include filtering a sales PivotTable by region, showing only selected products in an Excel table,…
- How to Save Excel Files to Google DriveTo save an Excel workbook in Google Drive, upload it at drive.google.com: select New > File upload, choose…
- How to Paste Filtered Data in Excel Without ErrorsTo paste only the rows currently shown by a filter, select the filtered data without its header, choose…
- Excel Sum Filtered List: SUBTOTAL and SUMTo sum only the rows currently visible after filtering in Excel, use =SUBTOTAL(109,B2:B6), assuming the values are in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.