How to use the Random Number Generator
- Select Number Range, Roll Dice, or Flip Coin.
- Set the controls for the chosen mode: Min, Max, and Count; a die type and Number of dice; or Number of coins.
- Change a value or checkbox. The page generates a new result as the setting changes.
- Use Copy or Download when Number Range returns values.
How to generate random numbers in a range
In Number Range, enter safe whole numbers in Min and Max. Min can equal Max, but it cannot be greater than Max. Whole-number Count values outside 1 through 10,000 are clamped to that interval; a non-whole or unsafe value produces an error. The generator also stops when the selected range is too wide to represent safely.
Allow duplicates starts checked, so the same value can appear more than once. Clear it to request distinct numbers. If Count is greater than the number of integers in the range, the tool reports the conflict. Sort results puts the returned values in numeric order.
Min: 1
Max: 100
Count: 1
Result: 47
The generator runs in the browser. When window.crypto.getRandomValues() is available and the range is no wider than 0xffffffff, the script uses it; wider ranges use Math.random(). The page makes no request containing your settings or results, so they stay in the browser.
How Random Number Generator handles duplicates
With Allow duplicates cleared, the generator selects distinct integers and does not repeat a returned value. With it checked, each selection is made independently between Min and Max. One result appears as a number token. Multiple results appear one per line, with Copy and Download below them.
What Roll Dice and Flip Coin return
Roll Dice includes d4, d6, d8, d10, d12, d20, and d100. Number of dice stays between 1 and 20, and the result shows every roll plus a Total. Flip Coin keeps Number of coins between 1 and 20, lists every Heads or Tails result, and reports the two counts.
Where a random number generator comes up
- A tabletop player can choose d20 for an ability check, or roll several d6 dice and read the combined Total.
- A teacher can set Min to 1 and Max to 100 for a probability exercise, then turn on Sort results for an ordered list.
- A developer can generate integers for test records or numeric input checks, choosing Allow duplicates to match the data being prepared.
- A group choosing between two options can select Flip Coin and read the Heads or Tails result.
When another generator fits better
This page sits in Text Generation Tools, alongside generators for names, identifiers, quotes, and other random values. Choose the Random String Generator when you need configurable character types, length, or a batch of text strings. Choose the UUID / GUID Generator when the output must be RFC 4122 version 4 UUIDs with a selected case or brace format.
Frequently asked questions
How do I generate a random number between two numbers?
Set Min and Max to the two bounds in Number Range, then leave Count at 1. The result is one whole number inside those bounds, including the bounds themselves.
Can Random Number Generator avoid duplicates?
Yes. Clear Allow duplicates to request distinct values. Count cannot exceed the number of integers between Min and Max.
How many dice can I roll at once?
Set Number of dice to a whole number from 1 through 20. Select the die type, then read each roll and the displayed Total.
How many coins can I flip?
Set Number of coins to a whole number from 1 through 20. Flip Coin lists every Heads or Tails result and gives the two counts below them.
Can I copy or download generated numbers?
Yes. Number Range enables Copy and Download when it has values to return, and Download saves them as random-numbers.txt with one number per line.