glunty

Random Number Generator

Pick a range, a count, and unique or not. Random integers from your browser crypto RNG, nothing transmitted.

What this tool does

Generates random whole numbers in a range you choose, with both ends included. Set a minimum, a maximum, and how many numbers you want, then optionally require that they be unique (no repeats). Every value is drawn from crypto.getRandomValues, the browser cryptographically secure random number generator, and mapped onto your range with rejection sampling so there is no bias toward the low end. It never uses Math.random. Runs entirely in your browser. Verify it yourself: open developer tools, switch to the Network tab, and click Generate. Zero requests, nothing transmitted.

How to use it

Type a Minimum and a Maximum (both are included in the results), set How many numbers you need, then click Generate. Tick Unique (no repeats) when you need distinct values, such as picking raffle winners. Choose comma-separated or one per line for the output, then use Copy to grab the whole list. For a single six-sided die roll, set the range to 1 and 6 with a count of 1. If you enter a minimum larger than the maximum, the tool quietly swaps them and tells you.

Common use cases

  • Rolling dice or simulating any range of pips (1 to 6, 1 to 20, and so on).
  • Picking raffle, giveaway, or lottery-style winners with unique numbers.
  • Choosing a random row, item, or index from a numbered list.
  • Generating sample or test data across a bounded range.
  • Drawing a fair random pick when you want to settle something without arguing.

Common pitfalls

  • Unique needs enough room. You cannot draw more distinct numbers than the range contains. Asking for 10 unique values from 1 to 6 is impossible, so the tool shows an error. Widen the range, lower the count, or allow repeats.
  • Both ends are inclusive. A range of 1 to 100 can return 1 and can return 100. If you expect an exclusive upper bound, set the maximum one lower.
  • Numbers are not secrets. A small integer is easy to guess even when the draw is cryptographic. For passwords, keys, and tokens use the password and token generator, which produces high-entropy values.
  • Avoid the naive modulo trick. Taking a raw random value modulo the range size skews results toward the smallest numbers. This tool uses rejection sampling instead, so the distribution stays uniform across the whole range.

Frequently asked questions

How random are the numbers?
Every number comes from crypto.getRandomValues, the browser cryptographically secure random number generator (CSPRNG). This tool never uses Math.random, which is predictable. To map raw random bytes onto your range without favoring the low end, it uses rejection sampling: it draws just enough random bits, discards any draw that lands in the leftover region above the range, and retries. That removes the modulo bias a naive remainder would introduce, so every integer in your range is equally likely.
Are the minimum and maximum inclusive?
Yes, both ends are inclusive. A range of 1 to 6 can return 1, 2, 3, 4, 5, or 6, which is why it models a six-sided die. A range of 0 to 9 returns any single digit. The count of possible outcomes is maximum minus minimum plus one, so 1 to 6 has six possible values.
What does the unique (no repeats) option do?
With unique unchecked, each number is drawn independently, so the same value can appear more than once, like real dice rolls. With unique checked, the tool keeps drawing until it has the requested count of distinct values, so no number repeats. This is what you want for a raffle, a lottery-style draw, or picking several different items. If you ask for more unique numbers than the range can supply, the tool shows a clear error instead of looping forever.
Why did I get an error asking for unique numbers?
Unique mode needs at least as many possible values as the count you request. The range 1 to 6 has only six distinct values, so asking for seven unique numbers is impossible and the tool tells you so. Either lower the count, widen the range, or turn off unique so repeats are allowed.
What happens if the minimum is larger than the maximum?
The tool swaps them automatically and notes that it did. So entering a minimum of 100 and a maximum of 1 is treated as the range 1 to 100. Nothing breaks and you still get numbers in the intended span.
Can I use these numbers for security, passwords, or keys?
The randomness itself is cryptographic, but a bare integer is a poor secret because its range is usually small and guessable. For passwords, API keys, and tokens use the password and token generator instead, which produces long values with enough entropy. This tool is built for dice, drawings, sampling, test data, and everyday random picks.
Is anything sent to a server when I generate?
No. Generation happens entirely in JavaScript on your device. Nothing is uploaded, logged, or stored anywhere off your machine. You can confirm it yourself: open your browser developer tools, switch to the Network tab, and click Generate. You will see zero requests.

Embed this tool

Free for any use; attribution appreciated. Paste this on your site:

The embed runs the same tool that lives at this URL. No tracking; no ads inside the embed. Resize height as needed for your layout.

Cite this tool

For academic, journalistic, or technical references. Pick a format:

Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.

Embedded tool from glunty.com