Skip to content
RandoKit
EN

Random Number Generator

Set a minimum, a maximum, and how many numbers you need. Choose whether repeats are allowed and whether results should be sorted. Numbers are drawn with the Web Crypto API using rejection sampling, so the distribution stays uniform.

History

No results yet. Run the tool to see history here.

Runs in your browser

Everything happens locally on your device. Your names and lists are never uploaded, and results use your browser's secure randomness.

RandoKit is intended for casual and everyday decisions. It is not certified for regulated gambling, official lotteries, or legally binding drawings.

How to use it

  1. 1Set the minimum and maximum value.
  2. 2Choose how many numbers to generate.
  3. 3Decide whether duplicates are allowed and whether to sort the output.
  4. 4Press Generate numbers, then copy the results.

Example use cases

  • Picking lottery-style numbers for a friendly office pool.
  • Generating a random PIN-like code for a classroom game.
  • Choosing a random page or question number from a book.
  • Sampling random row numbers from a spreadsheet.

About this tool

How the number generator computes a draw

You set a minimum and a maximum, and the tool treats both bounds as inclusive โ€” asking for 1 to 10 can return 1 or 10, not just the numbers between them. Under the hood, each number is produced with crypto.getRandomValues(), which reads from the browser's cryptographic random source rather than Math.random(). Because the range you request rarely divides evenly into the raw bytes the API returns, the tool uses rejection sampling: it discards any raw value that would introduce a slight bias toward the low end of the range (the classic "modulo bias" problem) and re-draws until it gets a value that maps cleanly onto your range. The result is that every integer in [min, max] has exactly equal probability, not an approximation of it.

Count, duplicates, and sort order

The "how many numbers" setting controls how many values come out of a single draw. With duplicates allowed, each number is drawn independently, so the same value can appear more than once โ€” useful for simulating repeated dice-like rolls or generating random amounts. With duplicates forbidden, the tool draws without replacement: once a number is picked it's removed from the eligible pool, guaranteeing a set of distinct values. Sorting is purely cosmetic and happens after the draw โ€” choosing ascending or descending order doesn't change which numbers were picked, only how they're displayed and exported.

Worked example: a 6-from-49 style pick

Say you want to draw 6 unique numbers between 1 and 49, sorted ascending, to run a private lottery-style pool. Set min to 1, max to 49, count to 6, and turn off duplicates. The tool draws the first number from all 49 candidates, removes it, draws the second from the remaining 48, and so on until 6 numbers are chosen, then sorts them for display โ€” something like 3, 11, 22, 29, 34, 47. Every one of the 49 numbers had an equal 1-in-49 chance of being the first pick, and the full combination is one of just over 13.9 million equally likely 6-number sets.

When to use this vs. other RandoKit tools

Reach for this tool whenever you need plain numeric output โ€” raffle ticket numbers, sample sizes for a survey, a seed value, or picking a handful of unique numbers from a large range. If your goal is actually to roll dice with the sum-of-multiple-dice distribution tabletop games use, the dice roller is the right tool instead, since a d20 roll and a "random number 1-20" pick behave the same, but 2d6 does not behave like a flat 2-12 range (see the dice roller's page for why). And if you're choosing from a list of names rather than numbers, use the random winner picker. For background on the underlying math, the guide on how random number generators work goes deeper.

Common mistakes

  • Forgetting that bounds are inclusive and setting max one lower than intended, silently excluding a value you wanted eligible.
  • Requesting a "duplicates forbidden" draw with a count larger than the range itself, which isn't possible โ€” you can't draw 10 unique numbers from a 1-5 range.
  • Assuming a small sample of draws will look evenly spread out. Ten draws from 1-100 will often leave visible gaps and a cluster or two purely by chance, not by a flaw in the tool.

Fairness and modulo bias

A naive way to turn a random byte into a "random number 1-49" is to take the byte modulo 49, but because 256 (the range of a byte) doesn't divide evenly by 49, low numbers would come up very slightly more often than high ones. Rejection sampling avoids this: the tool only accepts raw random values that fall within an evenly-divisible range for your min/max, and discards the rest before re-rolling, which removes the bias entirely rather than shrinking it. See Math.random() vs crypto.getRandomValues() for a fuller comparison of why this matters.

Privacy

All number generation happens locally in your browser โ€” nothing about your range, count, or results is sent to a server. Past draws are kept in your browser's local storage only, and you can export results as .txt or .csv, or share a draw via an encoded URL, without any data leaving your device.

Frequently asked questions

Are negative numbers supported?

Yes. Any integer range is accepted as long as the maximum is greater than or equal to the minimum.

Why can't I generate unique numbers?

If you ask for more unique numbers than the range contains, the tool warns you. Widen the range or allow duplicates.

Is the distribution uniform?

Yes. Rejection sampling on crypto.getRandomValues() removes the modulo bias that naive implementations have.

Guides that use this tool