Random Number Generator
Generate one or many random numbers in any range, with options for integers vs decimals, with or without repeats, and sorted or unsorted output. Uses the browser's cryptographic random source, so the numbers are genuinely unpredictable — not the seeded pseudo-random output most generators produce.
Why Quality of Randomness Matters
Not all randomness is equal. Math.random() in JavaScript is a pseudo-random number generator: given the same internal state, it produces the same sequence. That's fine for shuffling a music playlist or picking a placeholder colour, but unacceptable for anything where predictability is a problem — password generation, security tokens, sample selection in research, drawing winners from a public contest.
crypto.getRandomValues() is the right primitive when randomness has to be unpredictable. It pulls from the operating system's entropy pool — keyboard timings, network packet jitter, hardware noise — which means the next number can't be derived from the previous one. This generator uses crypto.getRandomValues() for every output, even the playful uses, so the same code path serves both casual and serious work.
How It Works
For integer generation in a range, the tool uses rejection sampling against crypto.getRandomValues() to avoid the modulo-bias problem that simpler implementations have. (Naive code like crypto_random() % 100 produces slightly-biased output toward lower numbers when the underlying range isn't a multiple of 100; rejection sampling fixes this.) For decimal output, it generates a uniformly-distributed 64-bit float using the standard IEEE 754 mantissa trick. For the without repeats mode, the tool maintains a Set of already-issued values and re-draws until it gets a fresh one — which is fine when the range is comfortably larger than the count requested, and warned about when it isn't.
Need a single secure token instead of a number? The password generator and UUID generator use the same crypto primitive for token-shaped output rather than numbers.
Common Use Cases
Picking a winner from a numbered entry list — generate one integer in [1, N]. Selecting a random sample of rows from a CSV — generate K unique integers in the row-count range, no repeats. Generating test data that needs to look plausibly random rather than sequential. Picking a random colour seed for a generative design. Drawing random angles for a parametric animation. Rolling dice for tabletop games when you don't have physical dice handy.
How We Compare
Random.org pulls from atmospheric noise and is the gold standard for verifiable randomness — they publish their entropy methodology and offer signed certificates of randomness for high-stakes draws. For most use cases, crypto.getRandomValues() is already strong enough, and a local browser tool avoids the third-party dependency and the rate limit Random.org imposes on free use. Built-in spreadsheet RAND() functions use weaker pseudo-random sources and are not suitable for security-sensitive work. This generator runs locally and uses the same crypto primitive your browser uses for HTTPS.
Frequently Asked Questions
📖 Learn More
Related Guide Random Number Generator Guide →Built by Derek Giordano · Part of Ultimate Design Tools