All Tools

Random Number Generator

Generate cryptographically secure random numbers within any range. Single or multiple numbers at once.

Tips & Guide

True random vs pseudo-random

Computers cannot generate truly random numbers. They use algorithms (pseudo-random number generators, or PRNGs) that produce sequences that appear random. This tool uses the browser's crypto.getRandomValues() which is cryptographically secure and suitable for most purposes.

Cryptographically secure randomness

For security-critical uses (cryptographic keys, tokens, OTPs), always use a cryptographically secure random source. JavaScript's Math.random() is NOT cryptographically secure. It is predictable. This tool uses window.crypto, which is.

Dice and probability

A standard die (1–6) has a 1/6 ≈ 16.67% chance per outcome. Two dice (2–12) don't have equal probability. The number 7 is most likely (6/36 = 16.67%) and 2 or 12 least likely (1/36 ≈ 2.78%). Use this tool to simulate any die size.

Lottery numbers

UK National Lottery: pick 6 numbers from 1–59. Each combination has an equal 1 in 45,057,474 chance. Statistically, every combination is equally likely. Hot or due numbers are a gambler's fallacy. A random generator gives you exactly the same odds as any manual pick.

Generating a list

Need multiple unique random numbers? Generate one at a time and discard duplicates, or use a shuffle algorithm (Fisher-Yates) on a range. For truly independent picks (like dice rolls), repeats are allowed by design.

Random numbers in testing

Random test data is useful but can make bugs hard to reproduce. Many testing frameworks seed their random number generators so tests produce the same output each run, ensuring reproducibility while still varying data across seed changes.

Generate cryptographically secure random numbers within any range. Set minimum and maximum values, choose how many to generate, and click Generate for a new result.

How to use the Random Number Generator

  1. Enter the minimum value — the lowest number that can be generated.
  2. Enter the maximum value — the highest number that can be generated.
  3. Choose how many numbers to generate at once.
  4. Toggle No Duplicates to ensure each number appears only once in the list.
  5. Click Generate (or press Enter) to produce a new random result.

Examples

Simulating a six-sided die: min 1, max 6

A random integer between 1 and 6

UK National Lottery pick: 6 numbers from 1 to 59, no duplicates

6 unique random numbers between 1 and 59

Random percentage: min 1, max 100

A random integer between 1 and 100

This tool uses the browser's window.crypto.getRandomValues() API, which generates cryptographically secure random numbers — suitable for security-sensitive uses like token generation. Standard JavaScript Math.random() is a pseudo-random number generator and is NOT cryptographically secure; its output can be predicted if the internal seed is known.

Frequently asked questions

Are the limits included in the result?

The minimum and maximum values define the range available to the generator. Check the control labels to see whether the selected mode treats those limits as inclusive, then enter whole-number limits when you need an integer draw. Avoid swapping the bounds accidentally; a valid range must have a lower limit no greater than its upper limit.

Is this random generator suitable for passwords or prizes?

It is convenient for classroom exercises, games, test data, and informal selections. Do not use a browser utility as the sole source of randomness for passwords, access codes, cryptographic keys, gambling, or regulated drawings. Those uses need a cryptographically secure generator and, for formal prizes, a documented process that participants can audit.

How can I choose several different numbers?

Generate one value at a time and record each result if repeats are acceptable. If you need a draw without replacement, generate a larger list and remove or reject duplicates, then document the method. For a fair group decision, agree on the range and the duplicate rule before generating any results.

How can I make a random selection fair?

List every eligible option once, agree on the range and duplicate rule, and generate only after the list is final. Keep a record of the inputs and results so another person can review the process. Remove duplicate names or weights only when the selection rules explicitly require it.