Random Number Generator

Generate random numbers, roll dice, flip coins and pick random colours. Bulk generation with configurable ranges and duplicate control

How Random Numbers Are Actually Generated

Computers cannot produce truly random numbers. What they produce are pseudorandom numbers, generated by an algorithm that takes a seed and outputs a sequence so statistically uniform that you cannot tell it from random without running the same algorithm yourself. JavaScript's Math.random() typically uses a variant of Mersenne Twister or xorshift, which are fine for everyday use but predictable enough that you should not rely on them for security.

When you do need cryptographic randomness (passwords, tokens, lottery picks where fairness is auditable), the browser exposes crypto.getRandomValues(), which pulls from the operating system's entropy pool. For a raffle or a homework spinner, Math.random() is plenty. For anything where someone could financially benefit from predicting the next number, use the crypto API or a server-side generator.

Common Uses Beyond Picking Names

Teachers use random number generators to pick a student to answer, choose pairs for group work, or shuffle question order on a printout. Game masters use them for dice rolls when running a tabletop campaign without physical dice. Statisticians use them to draw simple random samples from a list. Researchers use them for assigning participants to control or treatment groups, where any predictable pattern would bias the results.

Two settings matter most. Allow duplicates: turn this on if you want each draw independent (rolling dice repeatedly), off if you want unique picks (drawing 10 names from 30 students without repeating). Range: set the min and max carefully; the calculator includes both endpoints. For random selection from a fixed list of names rather than numbers, [Random Name Picker](/random-name-picker) does the same job with text input.

Generator Settings

SettingWhat It DoesWhen to Use
Min and MaxRange of possible numbers (inclusive)Set bounds for the draw
QuantityHow many numbers to generate1 for a single pick, more for a sample
Allow duplicatesSame number can appear twiceDice rolls, repeated draws
DecimalsGenerate decimal values, not just integersStatistical simulations
PrecisionHow many decimal placesMatch the precision of your data

Frequently Asked Questions

Are these numbers really random?

They are pseudorandom. The output is statistically indistinguishable from random for any everyday use, but it is generated by an algorithm and could theoretically be replayed if you knew the seed. For lotteries, raffles, or anything you need to defend the fairness of, a cryptographic source (or a physical method, like drawing names from a hat) is safer.

How do I generate a number between 1 and 100?

Set the minimum to 1 and the maximum to 100, with quantity 1. Both ends of the range are inclusive, so you might see a 1 or a 100. If you want unique picks (no repeats), turn off 'allow duplicates' and set the quantity to however many you want.

Can I use this for dice?

Yes; switch to dice mode and pick the number of sides. Standard tabletop dice are d4, d6, d8, d10, d12, d20, and d100 (two d10s read together). The tool can roll multiple at once and shows each individual roll plus the total, which is what you want for damage rolls or initiative in role-playing games.

Why should I not use this for a real lottery or competition?

Math.random() is deterministic given its seed, and a determined party could in theory replay your draws. For real prize draws, regulators usually require either a physical method (drum, ping-pong balls) or a certified random number service that produces an audit trail. For class raffles and birthday party games, this is fine.

More tools β†’