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.
Generate
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
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.