Random Decimal Generator

Random Decimal Generator generate decimal values random fixed decimal places secure random decimal range
Random Decimal Generator

Generate values on a fixed decimal grid

Choose an inclusive minimum and maximum, 0 through 9 decimal places, and 1 through 100 results. Each line uses exactly the selected number of decimal places.

Advertisement

What can be generated

The selected decimal places define a grid. With minimum 1, maximum 2, and two decimal places, possible values are 1.00, 1.01, 1.02, through 2.00. Both endpoints can appear when they fall on that grid. Entered bounds are rounded to the selected grid before generation.

Web Crypto and rejection sampling

The page requests unsigned 32-bit values from crypto.getRandomValues(). Rejection sampling discards the top incomplete portion of that range before mapping a value onto the requested number of steps. This avoids the simple modulo bias that can make some positions slightly more likely than others.

Worked example

A range from -1 through 1 with one decimal place contains 21 possible positions: -1.0, -0.9, and so on through 1.0. Asking for five values performs five independent selections. Repeated results are allowed because this is sampling with replacement.

Precision and range guard

The implementation scales values into JavaScript safe integers. To keep that conversion dependable and generation responsive, the selected grid may contain no more than one billion distinct steps. Large magnitudes or many decimal places may be rejected even when each typed value is finite. Reduce decimal places or narrow the range in that case.

Appropriate uses

This tool can help make sample inputs, classroom exercises, game values, or quick test data. It does not certify statistical quality for research, regulated drawings, gambling, lotteries, cryptographic secrets, security tokens, financial simulation, or safety-critical decisions. Independent values are not guaranteed unique or balanced across a small sample.

Limitations and privacy

Generation happens locally and values are not uploaded. Results depend on browser Web Crypto availability. The page does not seed a repeatable sequence, save history, chart a distribution, remove duplicates, or provide arbitrary-precision decimal arithmetic.

Random Decimal FAQ

Can minimum and maximum appear?

Yes. Range endpoints are inclusive after they are aligned to the chosen decimal grid.

Why do results repeat?

Each selection is independent; uniqueness is not part of this tool.

Is this the same as Math.random()?

No. The page uses browser Web Crypto and rejection sampling.

Related tools

Categories

Tags