Random Number Generator

Generate random integers, decimals, or unique random numbers within any range. Set the count and copy results instantly.

Random Integer(s)

How to Use This Tool

  1. Choose a mode: Integer, Decimal, or Coin / Dice.
  2. For Integer mode, enter a minimum and maximum value, the count of numbers to generate, and optionally enable "No duplicates".
  3. For Decimal mode, enter a minimum and maximum value, the number of decimal places, and the count.
  4. For Coin / Dice mode, select coin, D6, D20, or D100, and how many times to flip or roll.
  5. Click Generate to produce the results, then use Copy to copy them to your clipboard.

Formula & How It Works

Random Integer in Range

result = floor(random() × (max − min + 1)) + min

Scales a random value between 0 and 1 into a whole number between min and max, inclusive.

Random Decimal in Range

result = random() × (max − min) + min

Scales a random value between 0 and 1 into a decimal number between min and max, then rounds to the chosen number of decimal places.

Unique Sampling (No Duplicates)

Shuffle the full range, then take the first N values

Every integer in the range is placed in a list, randomly shuffled, and the first N are kept so no value repeats.

Practical Examples & Common Use Cases

Example: Random Integer Between 1 and 100

With min = 1 and max = 100, result = floor(random() × (100 − 1 + 1)) + 1. A random() value of 0.42 gives floor(0.42 × 100) + 1 = 43.

Example: Random Decimal Between 0 and 1

With min = 0, max = 1, and 4 decimal places, result = random() × (1 − 0) + 0. A random() value of 0.8173 rounds to 0.8173.

Example: Rolling a D20 Five Times

Selecting D20 with count = 5 generates five independent integers between 1 and 20, e.g. 14, 3, 20, 7, 11.

Frequently Asked Questions

It uses JavaScript's Math.random() to generate pseudo-random numbers uniformly distributed between 0 and 1, then scales and rounds them to the requested range.

They are pseudo-random, generated by a deterministic algorithm seeded by entropy. For cryptographic purposes, use a dedicated CSPRNG. For games, lotteries, and statistical sampling, this is sufficient.

Enabling "no duplicates" ensures each generated number is unique, like drawing numbers from a bag without replacement. The range must contain at least as many values as your requested count.

Related Tools