Random Decimal Generator
Generate random floating-point numbers with a fixed precision.
Random Decimal Number Generator
Generate random decimal numbers (floating-point values) between any two bounds with the exact number of digits after the decimal point that you need. The default settings produce numbers between 0 and 1, the classic output of Math.random(), but you can just as easily create prices, percentages, measurements or GPS coordinates.
Options
- Minimum and maximum – any real numbers, including negatives such as -273.15.
- Decimal places – between 1 and 15 digits after the point.
- Remove trailing zeros – write 2.5 instead of 2.5000.
- Order – random, ascending or descending.
- Presets – 0 to 1, shop-style prices with two decimals, and latitudes with six decimals.
Continuous values
Unlike the integer generators, this tool draws from a continuous range: a value is picked uniformly anywhere between the bounds and then rounded to the chosen precision. That makes it a good fit for simulations, Monte Carlo experiments, noise in charts, and statistics exercises where you want values that look like real measurements.
Example uses
Front-end developers fill product cards with random prices. Data engineers create float columns for CSV fixtures. Teachers make rounding and decimal arithmetic worksheets. Game developers draw random speeds, angles and drop chances.
Accuracy notes
Values are produced with the browser's secure random generator and formatted with toFixed, so the output always has exactly the requested number of places unless you trim the zeros. Results are clamped to your bounds, so rounding never pushes a value outside the range.
If you need whole numbers, use the Random Number Generator; for exact ratios like 3/8, try the Random Fraction Generator.
Frequently Asked Questions
How many decimal places can I get?
From 1 to 15. JavaScript numbers carry about 15–17 significant digits, so more places would only add noise instead of real randomness.
Why do some results end in zero?
With fixed places every value has the same length, so 0.5 at four places is shown as 0.5000. Turn on 'Remove trailing zeros' to print it as 0.5 instead.
Is this like Math.random()?
With the default 0 to 1 range it produces the same kind of value, but it uses the cryptographically secure crypto.getRandomValues source with 53 bits of randomness per number.