Numbers

Random Decimal & Fraction Generator

Generate a random decimal number to any precision, or a simple random fraction — useful for measurements, pricing tests, and maths practice.

Cryptographically secure Instant, in your browser Free, no sign-up

Generate

Your result will appear here

How the Random Decimal & Fraction Generator works

While the standard number generator only returns whole integers, many use cases — unit price testing, scientific measurement simulation, randomized coordinates — call for decimal precision. This tool draws a uniform random floating-point value across your chosen range and formats it to your requested number of decimal places.

Internally, it starts from a 32-bit cryptographically secure random integer, normalizes it to a floating-point value between 0 and 1, then linearly scales that into your minimum–maximum window before rounding for display — keeping the same security properties as Xrandom's integer tools.

How to use it

1
Set the decimal rangeChoose a minimum and maximum — for example 0 to 1 for a probability, or 10 to 20 for a measurement.
2
Pick precisionDecide how many decimal places you need, from whole-feeling values to ten-digit precision.
3
GenerateXrandom scales a cryptographically secure random fraction into your chosen range and precision.

Frequently asked questions

Can the minimum be negative?

Yes, for example −10 to 10 works for generating values centred around zero.

How many decimal places can I request?

Up to 10 decimal places, which is more precision than the display can meaningfully show for very large ranges but is exact for smaller ones.

Is this good for generating test prices?

Yes — set a realistic min/max and two decimal places for currency-style random test data.