Random Number Generator

A general-purpose random number generator that produces integers or decimals within a min/max range you choose, with configurable decimal precision and batch count. Runs entirely client-side using Math.random(), suitable for sampling, test data, and everyday picking tasks that don't need cryptographic randomness. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool generates random numbers within a range you specify, in either integer or decimal form, and can produce a single value or a batch of up to 1,000 in one go.

It's designed as a flexible, everyday number generator — for picking a random participant number, sampling test values, or seeding a spreadsheet with placeholder data.

What Is Random Number Generator?

A configurable random number generator with a minimum, a maximum, a mode switch between whole numbers and decimals, and a count for how many values to produce.

In decimal mode you also choose how many digits appear after the decimal point, so output can look like '3.7' or '3.71829' depending on the precision your use case needs.

How Random Number Generator Works

For integer mode, the tool rounds the min up and the max down to the nearest whole numbers, then picks uniformly among the whole numbers in between using Math.random().

For decimal mode, it samples a floating-point value uniformly across the full min/max range and formats it to the requested number of decimal places.

Because the output must differ between server-rendered HTML and the client during hydration, the tool only computes real values after the page has mounted in the browser, showing an empty result until then.

When To Use Random Number Generator

Use integer mode for things like picking a random row number, a dice-like value outside the usual 1-6 range, or a batch of sample IDs.

Use decimal mode when you need fractional values for test data, statistics demonstrations, or filling in placeholder measurements.

Features

Advantages

  • Single tool covers both integer and decimal use cases instead of forcing a choice between separate generators.
  • Batch generation up to 1,000 values means you can build a quick list of test data without repeated clicks.
  • Runs fully in the browser with no network round trip, so results appear instantly.

Limitations

  • Uses Math.random(), which is not cryptographically secure and should not be used for anything requiring unpredictability guarantees, like security tokens.
  • Decimal precision is capped at 10 places to keep the output readable and avoid floating-point display artifacts.

Examples

Integer between 1 and 100

Input

(no input; generated from settings: min 1, max 100, integer mode)

Output

57

A single whole number sampled uniformly from the inclusive range.

Batch of decimals

Input

(no input; generated from settings: min 0, max 1, decimal mode, 3 places, count 5)

Output

0.482
0.019
0.771
0.305
0.914

Five independent decimal samples, one per line.

Best Practices & Notes

Best Practices

  • Pick integer mode whenever you don't need fractional precision — it's easier to read and copy into spreadsheets.
  • Use the batch count instead of clicking Regenerate repeatedly when you need a list of values.
  • Widen the min/max range if you need more variety in the output distribution.

Developer Notes

Integer mode rounds min up and max down with Math.ceil/Math.floor before sampling, so a range like [1.5, 4.5] correctly produces only whole numbers 2, 3, or 4.

Random Number Generator Use Cases

  • Picking a random winner number from a range of ticket IDs
  • Filling a spreadsheet column with placeholder numeric data
  • Generating sample values for a statistics or probability demonstration

Common Mistakes

  • Expecting cryptographically unpredictable output — use a dedicated token or password generator for anything security-sensitive.
  • Forgetting to switch to decimal mode when a fractional value is actually needed, and then wondering why output is always rounded.

Tips

  • Set decimal places to 0 in decimal mode if you want to see the raw floating point rounding behavior instead of switching modes.
  • Use the Regenerate button to get a fresh batch without changing any settings.

References

Frequently Asked Questions