Random Number Generator
About this tool
Generate integers or decimal numbers inside a range. Each number is drawn
from crypto.getRandomValues when the browser provides it, and
falls back to Math.random when it does not.
How to use
- Set Min and Max.
- Set Count, from 1 to 1000.
- For fractions, enable Decimals and choose 0 to 10 decimal places.
- Click Generate, then Copy if you need the list elsewhere.
Behaviours worth knowing
- If Min is greater than Max, the two are swapped in the fields before generation.
- Integer mode uses the rounded-inward range, so both Min and Max can appear when they are whole numbers.
-
Decimal mode computes
min + u × (max − min)withubelow 1, so the upper bound is effectively excluded. - A range with no whole number in it, such as 1.2 to 1.8 in integer mode, reports that there are no integers to draw.
Example
Settings: Min 1, Max 6, Count 5, Decimals off One possible run: 4 1 6 2 5 Settings: Min 0, Max 1, Count 3, Decimals on, 2 places One possible run: 0.37 0.91 0.08
These are illustrative runs; every generation produces a new sequence.
Limits
-
The fallback is not cryptographic. On a context without Web Crypto the
page uses
Math.random, which is not suitable for keys, tokens or anything an attacker would want to predict. -
Decimal results are formatted with
toFixed, so the printed value is a rounded display of a floating-point number. - Count is clamped to 1000, and the whole list is produced in one synchronous loop.
FAQ
Are the numbers cryptographically secure?
Only when crypto.getRandomValues is available — which it is
on HTTPS and localhost. Otherwise the page falls back to
Math.random.
Is Max included?
For integers, yes. For decimals, no: the draw approaches Max but cannot equal it.
Can I get duplicates?
Yes. Each number is drawn independently, so repeats are normal and expected.