Random Number Generator🔒 100% local
Generate random integers or decimals with customizable range, count, sorting, and duplicate options.
Related Tools
Draws whole numbers or decimals from a range using Math.random. You set the minimum, maximum and how many values you want, choose integers or decimals with up to ten decimal places, decide whether repeats are allowed, and optionally sort the results. The comma-separated list is assembled in the page and can be copied.
How to use it
- Set Min, Max and Count - count accepts 1 to 10000.
- Choose Integers or Decimals, tick Allow duplicates if repeats are fine, and pick a sort order.
- Press Generate, then Copy Output to take the list elsewhere.
Worked example
min 1, max 6, count 5, no duplicates, ascendingbecomes2, 3, 4, 5, 6One actual run. Every draw is an independent Math.random call, so rerunning gives a different set - the numbers are not seeded from anything you can reproduce.
min 1, max 3, count 5, no duplicatesbecomes1, 2, 3Only three values came back because the range holds three integers and repeats were disallowed. Three consecutive runs each returned exactly these three numbers, with no warning that the request was impossible.
When to use it
- Picking a winner from a numbered list when you do not have dice or a hat.
- Sampling a few row numbers from a table to spot-check data by hand.
- Filling a test fixture with plausible values in a known range.
What it does not do
- Rejection sampling quietly returns fewer values than requested when the range is too small: min 1, max 3 with count 5 and duplicates disallowed yields three numbers, not five.
- Math.random is not a cryptographic source. Nothing produced here belongs in keys, tokens, session identifiers or draws where money or access depends on the outcome.
- Min and Max are parsed with parseInt, so typing a range of 0.5 to 2.5 gives you 0 to 2 even in decimal mode - keep the bounds as whole numbers.
- The bounds must be strictly ordered: equal values are refused with 'Min must be less than Max' rather than returning that one value.
- Decimal mode formats with toFixed, so values are rounded rather than truncated, and a narrow range at two decimals collapses into duplicates the de-duplication check then treats as equal.