ToolHub

Random Number Generator

Numbers, dice, coin flip, and list picker — crypto-secure

Uses your browser's cryptographically secure random generator (crypto.getRandomValues) with rejection sampling to avoid modulo bias — suitable for raffles, giveaways, and fair draws.

Overview

What this generator does

This is four random tools in one: a random number generator with range and uniqueness control, a dice roller for tabletop games, a coin flipper, and a list picker for raffles and giveaways. Every result uses your browser's cryptographically secure random source with rejection sampling to eliminate bias — fair enough for real draws, not just casual use.

How it works

True randomness vs pseudo-randomness

Computers can't produce truly random numbers from nothing — they use algorithms. The question is how good the algorithm is.

Math.random() — not good enough for draws

The standard Math.random() is a pseudo-random generator optimized for speed, not fairness or unpredictability. It's fine for animations and games, but its output can be predicted and its distribution isn't guaranteed uniform.

crypto.getRandomValues() — what we use

This generator uses your browser's cryptographically secure pseudo-random number generator (CSPRNG), seeded by your operating system's entropy pool (hardware noise, timing jitter, etc.). It's the same source used to generate encryption keys. Combined with rejection sampling, every number in your range is exactly equally likely.

Why fairness needs care

What is modulo bias?

The naive way to get a number in a range is random % range. The problem: unless the range divides evenly into the random source's full span, some outcomes become slightly more likely than others.

Imagine a random source that produces 0-9, and you want 0-2. Using modulo: 0,3,6,9 → 0; 1,4,7 → 1; 2,5,8 → 2. So "0" appears 4 times out of 10, while "1" and "2" each appear 3 times. That's a 33% bias toward 0. For a fair raffle, that's unacceptable.

How we fix it

We use rejection sampling: if a random value falls in the "biased zone", we discard it and draw again. This guarantees a perfectly uniform distribution, at the tiny cost of occasionally re-drawing.

What's included

The four modes

Numbers

Any range, any count. Toggle 'no duplicates' for unique results (lottery-style) and 'sort' to order them.

Dice

d4, d6, d8, d10, d12, d20, d100. Roll up to 50 at once, see individual results and the total. Built for D&D and board games.

Coin flip

One flip or hundreds. Multiple flips show the heads/tails tally — useful for probability demonstrations.

List picker

Paste names one per line. Pick a single random winner, or shuffle the whole list to show a fair, complete ordering.

Real-world applications

Common uses

  • Giveaways and raffles — pick a fair winner from entrants
  • Classroom — randomly select a student to answer
  • Team selection — shuffle a roster into random groups
  • Tabletop gaming — roll dice without physical dice
  • Decision making — coin flip for a 50/50 choice
  • Sampling — pick random rows or records for a spot check
  • Secret Santa — shuffle names for gift assignments
  • Contests — generate a random winning number

Behind the scenes

Privacy and how it runs

Everything runs in your browser

Your lists, numbers, and results never leave your device. The randomness comes from your own browser's secure generator. No server is involved, so results can't be logged or manipulated remotely.

Common questions

Is this random enough for a giveaway?

Yes. The crypto-secure source plus rejection sampling gives a provably uniform distribution. For maximum transparency in a public draw, use the list picker's 'shuffle whole list' option and screen-record the result so entrants can see the complete random ordering.

Can I generate numbers without repeats?

Yes — check 'No duplicates'. If you request more unique numbers than the range contains (e.g., 10 unique from 1-5), it returns the maximum possible without repeating.

How many numbers can I generate at once?

Up to 10,000 in a single batch. For unique numbers across very large ranges, the generator switches to an efficient set-based method to stay fast.

What dice are supported?

The standard polyhedral set: d4, d6, d8, d10, d12, d20, and d100 (percentile). Roll up to 50 dice at once with an automatic sum — handy for tabletop RPGs.

Is a coin flip really 50/50 here?

Yes. We map the secure random source to exactly two equally likely outcomes with no bias. Over many flips you'll see the tally converge toward 50/50, with normal short-run variance.

Quick steps

1

Pick a mode

Numbers, dice, coin flip, or list picker. Each tab is a self-contained generator.

2

Set your options

Range, count, unique vs duplicates for numbers. Sides and dice count for dice. Paste names for the list picker.

3

Generate

Results use crypto-secure randomness with no modulo bias — fair enough for raffles and giveaways. Copy results with one click.

Frequently asked questions

Is this random number generator truly random?

It uses crypto.getRandomValues(), your browser's cryptographically secure pseudo-random generator (CSPRNG), seeded by your operating system's entropy. We apply rejection sampling to eliminate modulo bias, so every number in your range is equally likely. This is fair for raffles, draws, and giveaways.

What's modulo bias and why does it matter?

The naive way to map a random number to a range (using % ) makes some outcomes slightly more likely when the range doesn't divide evenly. For a fair draw, that's unacceptable. We reject and re-draw values that would cause bias, guaranteeing a uniform distribution.

Can I generate numbers without duplicates?

Yes — check 'No duplicates'. The generator then guarantees every result is unique. If you ask for more unique numbers than the range allows (e.g., 10 unique numbers from 1-5), it returns the maximum possible.

Can I use this to pick a giveaway winner?

Yes. Use the List picker tab, paste your entrants one per line, and click 'Pick a random winner'. Each name has an exactly equal chance. For full transparency in a public draw, you can shuffle the whole list to show the complete random ordering.

What dice can I roll?

Standard d4, d6, d8, d10, d12, d20, and d100 (percentile). Roll up to 50 dice at once and see the individual results plus the total — useful for tabletop RPGs like D&D.

Does anything get sent to a server?

No. All randomness is generated in your browser. Your lists, numbers, and results never leave your device.