ToolNimba

๐ŸŽฒ Random Number Generator 1 to 20

Shihab Mia By Shihab Mia ยท Updated 2026-07-25

Result
-

This is a free online random number generator preset to the 1 to 20 range, and it already shows a result the moment the page loads. The minimum is set to 1 and the maximum to 20, so you get an instant, unbiased pick without touching a single field. This exact range is genuinely useful for rolling a virtual twenty sided die (d20) in tabletop games, picking one name or item from a list of up to 20 entries, or assigning random turn order among a small group. You can still edit the minimum, maximum, or how many numbers you want, and every pick stays equally likely across the full range.

What is the Random Number Generator 1-20?

A 1 to 20 range fits a specific set of everyday tasks honestly. It matches a twenty sided die (d20), the polyhedral die used in tabletop role playing games to resolve actions with a wide spread of outcomes. It also suits picking one person from a class, team, or list of up to 20 entries, choosing a random question number from a bank of 20 flashcards or quiz items, or assigning turn order among up to 20 players. It is not a stand in for lotteries or games that use a different number of balls or squares, so this page sticks to what the range genuinely supports rather than stretching the claim.

Fairness works the same way here as in any well built generator. The tool reads raw entropy from your browser Web Crypto API, then uses rejection sampling to map that value into the 1 to 20 range without bias. A naive approach that takes a random value and reduces it with the remainder operator (modulo 20) would make the low numbers very slightly more likely than the high ones, because 20 rarely divides evenly into the source range. Rejection sampling discards the small uneven tail of values so every one of the 20 numbers, from 1 through 20 inclusive, has exactly the same chance of appearing.

The duplicates toggle controls whether repeats are allowed. Leave Allow duplicates ticked and each pick is independent, exactly like rolling a d20 more than once; the same face can come up twice in a row, which is normal, not a flaw. Untick it and the tool draws without replacement using a partial Fisher-Yates shuffle, so every number in your result is distinct. Because the 1 to 20 range only holds 20 values, unique mode can never return more than 20 numbers no matter how high you set the how many field.

The how many and sort controls round out the tool. How many decides the size of your draw, and sort simply reorders the results from lowest to highest for easier reading once they are generated. Neither setting changes which numbers are possible or how likely each one is; they only change how many you draw and how the output is displayed.

When to use it

  • Rolling a virtual twenty sided die (d20) for tabletop role playing games such as Dungeons and Dragons.
  • Picking one student, name, or item at random from a class list or roster of up to 20 entries.
  • Assigning random turn order or player order among a group of up to 20 people.
  • Choosing a random question number from a quiz bank or flashcard set of 20 questions.
  • Running a quick guess the number warm up game with friends, family, or a classroom.
  • Selecting a random level, scenario, or card number in a game that uses a 1 to 20 numbering scheme.

How to use the Random Number Generator 1-20

  1. The minimum is already set to 1 and the maximum to 20, matching this exact range; leave them as is or edit them if you need a different span.
  2. Set how many numbers you want to generate; it defaults to 1 for a single pick.
  3. Tick Allow duplicates for independent picks like repeated d20 rolls, or untick it to draw unique numbers with no repeats.
  4. Optionally tick Sort results to list multiple numbers in ascending order.
  5. Click Generate for a fresh result, then click Copy to place the numbers on your clipboard.

Formula & method

The range 1 to 20 inclusive holds exactly 20 equally likely whole numbers. Each pick is drawn as an unbiased integer using rejection sampling on a 32 bit value from the Web Crypto API, discarding the small uneven tail so no number among the 20 is more likely than another. Unique mode draws without replacement using a partial Fisher-Yates shuffle over those 20 values, so it can never return more than 20 distinct numbers.
1 to 20, 20 equally likely values51015120Every whole number from 1 through 20 has an equal 1 in 20 chance

Worked examples

Roll a virtual twenty sided die (d20) for a tabletop game.

  1. Keep minimum at 1 and maximum at 20, the full d20 range.
  2. Set how many to 1 and leave Allow duplicates ticked, since a single roll does not need uniqueness.
  3. Click Generate; the tool draws one of the 20 faces with an equal 1 in 20 chance for each.

Result: One number from 1 to 20, for example 14, standing in for a d20 roll of 14.

Pick 5 unique students at random from a class roster of 20 names.

  1. Keep minimum at 1 and maximum at 20, matching the 20 students numbered on the roster.
  2. Set how many to 5 and untick Allow duplicates so no student is picked twice.
  3. Click Generate; the tool draws 5 distinct numbers without replacement.
  4. Match each number back to the corresponding position on the class list.

Result: Five different numbers between 1 and 20, for example 2, 7, 11, 16, 19.

Nearby ranges and what they genuinely suit

RangePossible valuesTypical use
1 to 66A single six sided die
1 to 1010A base ten pick or a small raffle of 10
1 to 1212Months of the year or a dozen based pick
1 to 2020A twenty sided die (d20) or a list of up to 20 items
1 to 100100Percentages or larger raffles and giveaways

How the duplicates toggle changes a 1 to 20 draw

SettingMethodMax numbers you can request
Allow duplicates onEach pick is independent (with replacement)Unlimited, values may repeat
Allow duplicates offDraw without replacement (shuffle)Up to 20, since only 20 values exist

Common mistakes to avoid

  • Asking for more than 20 unique numbers. With duplicates off, the tool cannot return more values than the range holds. Since 1 to 20 contains exactly 20 numbers, requesting 25 unique numbers is impossible; widen the range or allow duplicates instead.
  • Assuming 20 is excluded from the range. The maximum is inclusive. A 1 to 20 range can genuinely return 20 itself, not just numbers up to 19, so all 20 whole numbers are reachable results.
  • Expecting a single d20 roll to avoid repeats automatically. A single die roll should keep Allow duplicates ticked, since each roll is independent. Rolling a 14 twice in separate rolls is normal behaviour for a fair d20, not a bug in the tool.
  • Trusting a simple modulo based script for a d20 roll. A basic script that takes a random value modulo 20 introduces a small bias toward the low end of the range. This tool avoids that with rejection sampling so every one of the 20 faces is equally likely.

Glossary

Random number generator (RNG)
A process that produces numbers that are hard to predict, with each allowed value equally likely within the chosen range.
Twenty sided die (d20)
A die with 20 faces numbered 1 to 20, used in tabletop role playing games to resolve actions across a wide spread of outcomes.
Uniform distribution
A spread where every value in the range has exactly the same probability of being chosen, so no number is favoured over another.
Cryptographically secure
Randomness drawn from a high quality system source that cannot be predicted or reproduced, as provided by the Web Crypto API.
With and without replacement
With replacement means each pick is independent and numbers can repeat. Without replacement means each value is used at most once, like dealing cards.
Modulo bias
A subtle skew that appears when a large random value is reduced with the remainder operator and the range does not divide evenly, making some numbers slightly more likely.

Frequently asked questions

How do I generate a random number between 1 and 20?

The minimum and maximum are already set to 1 and 20, so a result is showing the moment the page loads. Click Generate for a new pick, or adjust how many numbers and the duplicates setting first.

Is this the same as rolling a d20?

Yes. A twenty sided die has 20 equally likely faces numbered 1 to 20, exactly matching this range. Leave Allow duplicates ticked and how many set to 1 to simulate a single d20 roll.

Can I pick more than one unique number between 1 and 20?

Yes, up to 20. Untick Allow duplicates and set how many to any number from 1 to 20, and the tool draws that many distinct values with no repeats.

Why can I still change the minimum and maximum?

The fields are preset to 1 and 20 for convenience, but they are not locked. Edit either value if you need a different range, and the same unbiased method still applies.

Is the random number between 1 and 20 truly unbiased?

Yes. It is drawn from the browser Web Crypto API and passed through rejection sampling, which removes the small bias a plain modulo calculation would introduce, so all 20 values are equally likely.

Does this tool store or send my results anywhere?

No. Every number is generated locally in your browser with plain JavaScript and the built in crypto functions; nothing is uploaded, logged, or sent over the network.