calc-hub logocalc-hub.net

Random Number Generator

Generate one or many random numbers within a specified range — integers or decimals, with or without duplicates.

How to use the Random Number Generator

  1. Enter your inputs into the Random Number Generator above.
  2. Results update instantly as you type — no submit button needed.
  3. Adjust any value to see how the result changes in real time.

How random numbers are generated

Pseudo-random output: x_n = f(x_(n−1)) with a uniform distribution mapped to your range

JavaScript's Math.random() returns a pseudo-random number in [0,1). Scaling to your range: min + Math.random() × (max − min). For integers, round or floor the result.

Worked example

Generate 5 random integers between 1 and 100: e.g., 47, 82, 13, 67, 29 (will differ each time). For decimals between 0 and 1 with 4 places: 0.4729, 0.8156, 0.1342, etc.

Frequently asked questions

Is this truly random?

No — it's pseudo-random, generated by a deterministic algorithm seeded from current state. Good enough for games, sampling, simulations and most applications. Not suitable for cryptography (use crypto.getRandomValues for that).

Can I generate without duplicates?

Yes — the calculator has an option to require unique values. The count of unique values must be ≤ the range size (you can't draw 100 unique integers from 1–50).

Can I set a seed for reproducibility?

Some implementations allow seeding for reproducible sequences — useful for testing. Browser Math.random() does not allow seeding; the calculator may provide a separate seedable mode.

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.