Random Number 1-20: How to Generate & Use It

How-to basics · Updated November 23, 2026

If you need a random number from 1 to 20, the quickest way is to use a random number generator (RNG) or a simple formula like =RANDBETWEEN(1,20) in Excel. This gives you an equally likely integer between 1 and 20, inclusive. Below, we explain how randomness works, how to generate numbers manually or with tools, and how to choose the best method for your situation.

What Does “Random 1-20” Mean?

A random number from 1 to 20 means each integer (1, 2, 3, … 20) has an equal chance of being selected. This is called a uniform distribution. In true randomness, past results don’t affect future ones—rolling a 20 doesn’t make a 1 more likely next time. For most casual uses like picking a winner or a game move, this is what you want.

How to Generate a Random Number 1-20

You have several options, depending on your tools:

  • Mental method: Think of a number—but this is biased. Humans are terrible at randomness, so avoid it for fair decisions.
  • Physical dice: Roll a 20-sided die (d20) used in tabletop games. It gives a true uniform random result.
  • Online generators: Websites like random.org use atmospheric noise for true randomness. Just set the range to 1-20.
  • Spreadsheet formula: In Excel, use =RANDBETWEEN(1,20). In Google Sheets, the same formula works.
  • Programming: In Python, random.randint(1,20); in JavaScript, Math.floor(Math.random()*20)+1.

Using Excel to Generate a Random Number 1-20

If you’re in Excel, the RANDBETWEEN function is the easiest. Here’s how:

  1. Click any cell, say A1.
  2. Type =RANDBETWEEN(1,20) and press Enter.
  3. Excel recalculates the number every time the sheet changes. To freeze it, copy the cell and paste as values (Ctrl+Shift+V on Windows, Cmd+Shift+V on Mac).

For a list of 10 random numbers, drag the fill handle down from A1 to A10. Each cell gets an independent random integer. Note: RANDBETWEEN is volatile—it recalculates on every edit, which can be annoying. If you need a static list, use the paste-as-values trick.

How to Choose a Random Number Without Tools

Sometimes you don’t have a die or a computer. Here are manual methods with acceptable randomness:

  • Use a watch: Look at the seconds digit (0-9). If it’s 0, treat as 10; combine two digits for 1-20? That’s messy. Better: use a coin and a die.
  • Coin + die: Roll a six-sided die. If you get 1-3, add 0; if 4-6, add 10. Then roll the die again: if you get 1-6, that’s your units digit. But this only gives 1-16. To get 1-20, you need a 20-sided die or a random number table.
  • Random number table: Use a book of random digits. Pick a row and column, take two digits. If the number is 01-20, use it; otherwise skip. This is tedious but unbiased.

For most practical purposes, a 20-sided die is the best physical tool. It’s cheap and designed for this exact range.

Common Problems and Misconceptions

One big misconception is that a random number generator “remembers” past results. For example, if you generate 5 numbers and none is 20, people think 20 is “due.” That’s the gambler’s fallacy—each draw is independent. The probability of getting a 20 on the next draw is still 1 in 20 (5%).

Another issue: using RAND() in Excel incorrectly. RAND() gives a decimal between 0 and 1. To get 1-20, you’d write =INT(RAND()*20)+1. But RANDBETWEEN is simpler and less error-prone.

Also, beware of “random” number generators in some programming languages that use a seed. If you seed with the same value, you get the same sequence. For security-sensitive applications (like lottery draws), use a cryptographically secure RNG.

Comparing Random Number Generators

Not all RNGs are equal. Here’s a quick comparison:

  • True RNG: Uses physical processes (radioactive decay, atmospheric noise). Best for fairness, but requires hardware or a service like random.org.
  • Pseudo-RNG: Uses algorithms. Excel’s RAND and most programming languages use pseudo-RNG. They’re fine for games and simulations, but not for cryptography.
  • Cryptographic RNG: Designed to be unpredictable. Used in security. Not needed for picking a number 1-20.

For a simple pick, any pseudo-RNG is fine. The difference only matters if someone could predict the sequence and exploit it.

Cost and Safety Considerations

Generating a random number is free with any method—no cost. Safety is rarely an issue, but there are edge cases:

  • If you’re using an online generator, be cautious about entering personal information. Most don’t require any.
  • If you’re using a random number to choose a winner in a contest, ensure the method is verifiable. A physical die roll or a recorded online generator is better than a mental pick.
  • If you’re using randomness for gambling or financial decisions, remember that randomness doesn’t guarantee outcomes. Don’t rely on it for important choices.

Alternatives to a Random Number 1-20

Sometimes you don’t need a uniform 1-20. Consider these alternatives:

  • Weighted random: If you want some numbers more likely (e.g., in a game), use a weighted table. In Excel, you can use RAND() with a lookup table.
  • Random without replacement: If you need to pick 5 unique numbers from 1-20, use RANDBETWEEN in a list and then remove duplicates, or use a shuffle algorithm.
  • Random decimal: If you need a decimal between 1 and 20, use =RAND()*19+1 in Excel.

For most purposes, the standard uniform integer is what you want. But knowing these options helps when your need is different.

Frequently Asked Questions

How do I get a random number between 1 and 20 in Google Sheets?

Use the same formula as Excel: =RANDBETWEEN(1,20). It works identically in Google Sheets. If you need a static value, copy and paste as values (right-click > Paste special > Values).

Is there a way to generate a random number 1-20 without a computer?

Yes. Use a 20-sided die (d20) from a game store. Roll it, and the top face is your number. Alternatively, use a deck of cards: assign numbers to cards, but that’s more complex. A d20 is the simplest physical method.

Can I use a random number generator for a fair coin flip?

Yes. If you need heads/tails, generate a random number 1-2 and map 1 to heads, 2 to tails. Or use =RANDBETWEEN(1,2) in Excel. It’s just as fair as a coin, assuming the RNG is unbiased.

Why does Excel give me the same random number every time?

Excel’s RANDBETWEEN recalculates when the sheet changes. If you see the same number repeatedly, it might be because you haven’t triggered a recalculation. Press F9 to force a recalculation. Also, if you copied the formula and pasted as values, it’s static.

How do I generate a random number 1-20 in Python?

Use the random module: import random; print(random.randint(1,20)). This gives a uniform integer. For a list of 10, use a loop or list comprehension.

What is the probability of getting a specific number like 7?

Since each number is equally likely, the probability is 1/20, or 5%. This is true for any single number in the range.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.