Skip to main content

Random Number Generator

Random numbers power everything from games and simulations to cryptography and statistical sampling. Our generator produces truly random integers, floats, and sequences using cryptographically secure randomness (CSPRNG via the Web Crypto API), with options for unique sequences, weighted randomness, and Gaussian (normal) distribution.

150100

Results

Last Generated

Count
Min result
Max result
Sum

Click Generate to get numbers

Common Use Cases

Pick lottery numbers 1–49, count: 6, no duplicates
Random percentage 0–100, decimals on
Shuffle team order 1–10, count: 10, no duplicates
Share this tool
Developer Tools

About the Random Number Generator

Random numbers power everything from games and simulations to cryptography and statistical sampling. Our generator produces truly random integers, floats, and sequences using cryptographically secure randomness (CSPRNG via the Web Crypto API), with options for unique sequences, weighted randomness, and Gaussian (normal) distribution.

How to use it

  1. Set your range (min and max values) and how many numbers to generate.
  2. Toggle unique mode to generate a non-repeating sequence (like lottery numbers).
  3. Choose distribution: uniform (default), Gaussian (normal), or weighted.
  4. See generated numbers with statistical analysis (mean, min, max, std dev).

Formula & methodology

Uniform integer: Math.floor(crypto.getRandomValues(new Uint32Array(1))[0] / 2^32 × (max − min + 1)) + min. Gaussian: Box-Muller transform on two uniform randoms: Z = sqrt(-2 × ln(U1)) × cos(2π × U2). Uniform float [0,1): getRandomValues byte / 256, chained for precision. CSPRNG vs Math.random(): crypto API is unpredictable; Math.random() is deterministic given seed.

Common use cases

  • Lottery and raffle: picking winners from a list
  • Game development: dice rolls, card shuffles, procedural generation
  • Statistical sampling: selecting random survey participants
  • Security: generating tokens, nonces, and one-time codes
  • A/B testing: random assignment of users to experiment groups

Frequently asked questions

No — Math.random() is a pseudorandom number generator (PRNG), producing a deterministic sequence from an internal seed. It's unpredictable enough for games and simulations but should never be used for security tokens, encryption keys, or anything requiring unpredictability. For security: use crypto.getRandomValues() in browsers or crypto.randomBytes() in Node.js. These use hardware entropy sources for genuine unpredictability.
Array selection: items[Math.floor(Math.random() × items.length)]. For security: const array = new Uint32Array(1); crypto.getRandomValues(array); items[array[0] % items.length]. For weighted selection: assign cumulative weights (item A: 0–0.5, item B: 0.5–0.8, item C: 0.8–1.0) and find which bucket a uniform random number falls in. Our tool handles weighted lists with custom probability assignments.

Related tools

All Tools →

Embed this tool on your site

Free for personal and commercial use. Just copy the snippet below.