Skip to content

Random Number Generator

Generate cryptographically secure random numbers within any range. Set min, max, and quantity. Free online tool, 100% client-side.

How are the random numbers generated?

This tool uses the crypto.getRandomValues() Web API to produce cryptographically secure random numbers. Unlike Math.random(), which uses a deterministic pseudorandom number generator that can be predicted if the seed is known, the Web Crypto API draws from the operating system's hardware entropy source — producing numbers suitable for security-sensitive applications including lottery draws, cryptographic key generation, and scientific sampling.

Range, distribution, and uniqueness

Numbers are generated with uniform distribution within your specified range — every integer between min and max (inclusive) has exactly equal probability of being selected. There is no bias toward any part of the range. When "Allow duplicates" is disabled, the tool uses rejection sampling (Fisher-Yates shuffle approach) to guarantee all numbers are unique — this is the mathematically correct way to draw without replacement. The maximum unique count is limited to the range size (max − min + 1).

Use cases for random number generation

Lotteries & raffles — draw unbiased winners from a numbered pool (e.g., pick 5 unique numbers from 1–100). Test data — generate random IDs, port numbers, or array indices for development and QA testing. Random dev ports — pick an unused port in the 3000–65535 range for local development servers. Sampling — randomly select participants from a numbered list for surveys or experiments. Games — simulate dice rolls (1–6), card draws, or random encounters. A/B testing — randomly assign users to experiment groups with verifiable, auditable fairness.

Privacy

All numbers are generated 100% in your browser. No data is sent to any server.