Skip to main content
Back to Numbers generators

Numbers

Random Number in Range Generator

Used by developers, writers, and creators worldwide.

A random number in range generator lets you produce integers or decimals between any two values you define — no code required. Set your minimum and maximum, pick a count up to whatever your range supports, choose decimal precision from 0 to 8 places, and hit Generate. Results land in a copy-ready list in one click. The unique-only toggle makes this more than a basic randomizer. Enable it and every value in the output appears exactly once, which matters for fair prize draws, sampling without replacement, or seeding test fixtures. Decimal mode opens up probability weights, Monte Carlo inputs, and simulated sensor readings that whole-number tools can't handle.

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Enter your lower bound in the Minimum field and your upper bound in the Maximum field.
  2. Set Count to the total quantity of numbers you want the generator to produce.
  3. Adjust Decimal places to 0 for whole integers or higher for fractional precision.
  4. Switch Unique only to Yes if you need every number in the output to be distinct.
  5. Click Generate, then copy the results directly into your spreadsheet, code, or document.

Use Cases

  • Running a no-duplicate prize draw for 50 raffle ticket numbers between 1 and 500
  • Generating 20 random floats between 0 and 1 as probability weights for a Jupyter notebook
  • Seeding a Jest fixture file with unique random integers across a valid database ID range
  • Simulating D20 dice rolls in bulk for a tabletop RPG encounter tracker
  • Producing random sensor voltage readings between two thresholds to stress-test a data pipeline

Tips

  • For lottery draws, set Unique to Yes and keep Count well below your max to ensure the draw feels fair and unpredictable.
  • When generating decimal values for probability models, use 4 decimal places — more precision rarely adds value and makes outputs harder to read.
  • If you need a random sample from a dataset, generate unique row indices between 1 and your total row count instead of sampling the data directly.
  • Negative ranges work perfectly for simulating temperatures, financial deltas, or coordinate offsets — just type a minus sign before your minimum value.
  • Paste the output column into Excel or Google Sheets and use SORT() to rank the numbers if you need an ordered random sample.
  • Re-clicking Generate with identical settings produces a fresh set each time, so iterate quickly when you need to find a distribution that looks right for your use case.

FAQ

how to generate random numbers in a range without duplicates

Set your min and max, then switch the Unique only dropdown to Yes before clicking Generate. The tool will ensure every number in the output list appears exactly once. Just make sure your Count doesn't exceed the total integers available in the range, or the generator will warn you.

is math.random safe enough for games and testing

For games, simulations, classroom activities, and test data, yes — browsers seed Math.random() unpredictably enough to be practically uniform. It's not suitable for cryptographic keys or security tokens; use the Web Crypto API for those instead.

can I generate random decimal numbers between 0 and 1

Yes. Set min to 0, max to 1, and raise Decimal places to 4 or more. You'll get outputs like 0.3821 or 0.0047, useful for probability weights, random thresholds, and Monte Carlo inputs. Both range boundaries are inclusive.