Random Number Generator

Draw one number or a thousand from any range, with optional no-repeats and sorting, plus dice and coin presets. Uses your browser's crypto randomness.

🌐 Español

🔒 Private by design: everything is generated locally in your browser and never uploaded to any server.

The modulo trap that most random pickers fall into

There is a bug so common in random number code that it has its own name. You take a random byte or word, you take the remainder against your range, and you call it done. It looks correct, it passes a casual eyeball test, and it is measurably wrong.

The reason is arithmetic. A 32 bit word has 4,294,967,296 possible values. If your range is 100 wide, that does not divide evenly, so the leftover values at the top of the space wrap around and land on the first few numbers of your range a fraction more often than the rest. On a handful of draws you will never notice. On a giveaway with ten thousand entries, or a simulation, the skew is real.

This generator throws those leftovers away instead. It computes the largest exact multiple of your range that fits inside 32 bits, draws words until one lands below that line, and only then takes the remainder. Words above the line are discarded and redrawn. The cost is an occasional extra draw; the benefit is a genuinely flat distribution.

Pulling twenty unique numbers between 1 and 500

  1. Leave What do you want to generate? on Random number (custom range).
  2. Set Minimum (ignored for dice/coin) to 1 and Maximum (ignored for dice/coin) to 500.
  3. Set How many numbers? to 20. The ceiling is 1000.
  4. Tick No repeats (unique numbers) so no value can appear twice.
  5. Tick Sort results if you want them in ascending order rather than draw order.
  6. Click Random Number Generator. The numbers appear one per line in a read-only box.
  7. Copy to clipboard takes the whole list. Generate more clears it and gives you the options back for another draw.

The output is plain lines with nothing around them, which is deliberate: it pastes straight into a spreadsheet column, a script, or a message without any cleanup.

Where the three modes really differ

The custom range mode is the only one that reads your minimum and maximum. The dice preset always draws from one to six and the coin preset always draws from a two-outcome space, printing the words rather than the raw digits. Both ignore the range boxes entirely, and the labels on those boxes say so rather than leaving you to guess.

That design choice repeats across this site wherever one tool covers several modes: fields belonging to an inactive mode stay on screen and go unread, instead of the page rearranging itself under your cursor.

Coin flips inherit everything the numeric path has. The draw is cryptographic, the distribution is flat, and asking for two hundred flips gives you two hundred lines you can paste somewhere and count.

Two ways to ask for something impossible

A minimum above the maximum is refused rather than quietly swapped. Someone who types 100 and then 1 has almost certainly made a typo, and silently reinterpreting it would hide the mistake behind a plausible-looking result.

Asking for more unique values than the range can supply is refused too, and this one matters more than it sounds. Without the check, a request for ten distinct values from a range of five would keep drawing forever looking for a sixth that does not exist, and the tab would lock up. The count against range size happens before the first draw, so the refusal is instant.

Both refusals are honest inside the code and invisible on screen. The shell wrapped around this tool catches everything a tool throws and shows one fixed sentence about something going wrong, so the specific diagnosis never makes it to you. If you hit that banner, look at your range and your no-repeats tick before anything else.

Picking the right tool for the shape of your draw

A number is not always what you actually want. If you are picking a person rather than a value, Wheel of Names spins through a list you paste in and lands on one entry. For a bracket or a set of balanced groups, Team Generator and Bracket Generator do the allocation for you rather than making you map numbers back onto names.

For a tabletop session, Dice Roller gives you the animated version of the six-sided preset here, and Coin Flip does the same for the two-outcome case. When the random value is a secret rather than a pick, use Password Generator, which draws from the same cryptographic source with the same rejection sampling discipline applied at byte level. Everything else lives on the generators hub.

See it in action

Screenshot of the Random Number Generator tool with What do you want to generate? set to Random number (custom range), Minimum (ignored for dice/coin) set to 1
Random Number Generator mid-process: What do you want to generate? set to Random number (custom range), Minimum (ignored for dice/coin) set to 1.
Screenshot of the Random Number Generator result screen showing the generated output “12”
The finished result: the generated output “12”. The download link is a local blob URL — the file never leaves your device.

Frequently asked questions

Where does the randomness actually come from?

Your browser's cryptographic random source, the same one that seeds keys and session tokens. It is never the ordinary pseudo-random function that most number pickers on the web reach for. That matters for a draw, a giveaway or anything where somebody might have an incentive to predict the next value, and it costs nothing extra for the trivial cases.

Does taking a remainder not skew the results toward the low numbers?

It would, which is why that is not what happens here. Each draw takes a full 32 bit word, and any word landing above the largest exact multiple of your range is discarded and redrawn rather than folded back in. Only values from the clean portion are used, so every number in the range is equally likely instead of the first few being slightly favoured.

Why did I get a generic failure message instead of an explanation?

Because the surrounding shell replaces any thrown error with one fixed sentence about something going wrong while generating. Three things throw here, namely a minimum above the maximum, asking for more unique values than the range contains, and any range that cannot be resolved. If you see that banner, check those three before anything else, since the specific reason never reaches the screen.

Can I ask for ten unique dice rolls?

No, and it will refuse rather than hang. A die has six faces, so once six distinct values have come out there is nothing left to draw, and an endless search for a seventh would freeze the page. The check happens before any drawing starts. A coin is the same story with two outcomes instead of six, so no repeats plus a count above two is also refused.

What order do unique results come out in?

The order they were drawn, unless you tick the sorting option. Distinct values are collected as they arrive and printed in that sequence, so a run of unique numbers looks genuinely shuffled rather than climbing. Ticking the sort option reorders the whole batch smallest to largest afterwards, which is what you want for lottery-style output.

What do the minimum and maximum boxes do in dice or coin mode?

Nothing at all. Both presets carry their own fixed range, one to six for the die and a two-outcome flip for the coin, and whatever is sitting in the two range boxes is simply not read. They are left visible rather than hidden because the option layout is the same for every mode, and their labels say so directly.

How large a batch can I ask for in one go?

A thousand values, and the ceiling is enforced inside the generator rather than only by the input box, so editing the page will not raise it. A count that is not a real number falls back to one. The range itself is held inside plus or minus a billion, which keeps a single draw inside one 32 bit word and keeps the unbiased rejection maths exact.

Related tools