Random Number Generator

Generate random integers or decimals in any range, with or without duplicates.

Reviewed March 2026 How we build our calculators →
Generated Numbers
Share

The Formula

Formula
Random Integer = floor(Math.random() × (max − min + 1)) + min

Uses a pseudorandom number generator (PRNG) seeded by system entropy
Worked Example
Random number between 1 and 100:
= floor(random() × 100) + 1
Each result is equally likely
Probability of any value = 1%

Uses for Random Number Generators

Random number generators are useful for games, lotteries, statistical sampling, cryptography, simulations, and making decisions when you need an unbiased choice. Our generator uses JavaScript's Math.random() function for pseudorandom output.

Frequently Asked Questions

Is Math.random() truly random?

No u2014 it is pseudorandom, meaning it uses an algorithm to produce numbers that appear random. For most practical purposes this is sufficient. For cryptographic security, use the Web Crypto API instead.

Share
Scroll to Top