Decimal Random Number Generator

Generate uniformly-distributed random decimal numbers between any minimum and maximum, rounded to the number of decimal places you choose — one value or a whole list at once.

Quick Facts

Method
Uniform draw: min + (max − min) × random(), rounded to N decimals
Every value in [min, max) is equally likely. Pseudo-random, not cryptographically secure.

Your Results

Generated
First value
-
Random decimal in range
Count generated
-
Numbers produced
Range
-
Min to max, N decimals
Sample mean
-
Average of this batch

Ready

Set the range and precision, then press Generate.

Understanding the Decimal Random Number Generator

A decimal random number generator produces a number with a fractional part — such as 3.72 or 0.4185 — chosen at random from a range you define. Unlike an integer generator, which returns whole numbers like 4 or 17, this tool returns values that can fall anywhere between your minimum and maximum, limited only by the number of decimal places you request.

The draw is uniform: every value in the interval is equally likely, so over many generations the results spread evenly across the range with no clustering toward the middle or the ends.

The formula

Each value is computed from a base random number u that is uniformly distributed on [0, 1):

  • Scale and shift: value = min + (max − min) × u. This stretches the [0, 1) draw to fill your [min, max) range.
  • Round: the raw value is then rounded to your chosen number of decimal places N. For example, N = 2 keeps two digits after the point (0.01 resolution); N = 4 gives 0.0001 resolution.

Because u comes from the half-open interval [0, 1), the underlying value spans [min, max) — it can equal the minimum but never reaches the maximum exactly, though rounding can occasionally display a value at the max boundary.

A worked example

Suppose min = 5, max = 10, and the base draw is u = 0.6. Then value = 5 + (10 − 5) × 0.6 = 5 + 3 = 8.0. If instead u = 0.25, value = 5 + 5 × 0.25 = 6.25. Every intermediate result is equally likely, so across many runs the average settles near the midpoint, (min + max) / 2 = 7.5.

Where it is used

  • Simulation and Monte Carlo models: generating random inputs for prices, weights, arrival times, or measurement error.
  • Sampling and A/B assignment: drawing a random fraction to route users into test groups.
  • Teaching: demonstrating uniform distributions, rounding, and sampling variability in statistics classes.
  • Games and procedural generation: randomizing coordinates, speeds, or probabilities with sub-integer precision.

Frequently Asked Questions

Is the maximum value included in the range?
The generator draws from a continuous uniform distribution on the closed-open interval [min, max), so values run from the minimum up to — but not including — the maximum. In practice the difference is negligible because the results are rounded to your chosen precision; a rounded value can land on the maximum only when rounding nudges it there, while the raw draw never reaches max exactly.
Are these numbers truly random?
They are pseudo-random. The tool uses the browser's built-in Math.random(), which returns a high-quality, uniformly-distributed sequence that is more than adequate for simulations, sampling, games, and teaching. It is not cryptographically secure, so it should not be used for passwords, cryptographic keys, or anything where an adversary might predict the sequence — use a CSPRNG (such as crypto.getRandomValues) for those.
How many decimal places can I use?
You can request 0 to 15 decimal places. Standard JavaScript numbers are IEEE-754 doubles, which reliably represent about 15–17 significant decimal digits, so beyond 15 places the extra digits are not meaningful. Setting decimal places to 0 turns the tool into an integer generator across [min, max).