How to use the random number generator
- Choose Numbers, Dice or Coin flip.
- For numbers, set the minimum, maximum, how many you need, decimal places, whether duplicates are allowed, and an optional sort order. For dice, pick the die type, count and modifier.
- Press Generate, Roll or Flip. Results appear with a sum, lowest and highest for numbers, or a total for dice.
- Copy or download the results, or press the button again for a new draw.
Features
- Integer or decimal numbers (up to 6 places) in any range, including negatives
- Up to 10,000 numbers per draw, with or without duplicates
- Optional ascending or descending sort
- d4, d6, d8, d10, d12, d20 and d100 dice, up to 100 at a time, with a modifier
- Coin flips from 1 to 1,000 with heads/tails tallies
- Cryptographically random, unbiased draws using rejection sampling
Fair draws
Every value comes from crypto.getRandomValues, the same source browsers use for encryption keys. Numbers are chosen with rejection sampling rather than the usual modulo trick, so each value in the range has exactly the same probability; this matters when the range size doesn't divide evenly into the generator's output. For a draw without duplicates the tool either shuffles the whole range (small ranges) or keeps drawing until it has enough distinct values (large ranges).
Typical uses
Picking raffle or giveaway winners from numbered entries (set the range to the number of entries and turn duplicates off), choosing a random sample of rows from a spreadsheet, generating test data, deciding turn order, rolling for tabletop games, or settling a decision with a coin.