Crunchify.net

Random Number Generator

Generate secure random numbers, flip coins, and roll dice.

Number Generator

This tool uses the browser's crypto.getRandomValues() API, which generates cryptographically secure random numbers using the operating system's entropy source. This is fundamentally different from Math.random(), which uses a deterministic pseudo-random algorithm and is not suitable for security-sensitive applications.

Common uses: generating random samples for statistics, picking lottery numbers, running simulations, tabletop gaming, and anywhere you need unbiased, unpredictable values. The no-duplicates mode uses rejection sampling to ensure a perfectly uniform distribution across the selected range.

Link to this tool with values filled in

Everything after the # stays in your browser — it is never sent to a server — so a link like this opens the tool ready to go without the values travelling anywhere but the address bar:

https://crunchify.net/tools/random-number#mode=dice&sides=20&count=1

Join the settings with &, and percent-encode each value so that spaces, newlines and any #, &, = or % inside one do not break the link. Leave a setting out to accept its default. If a setting is not recognised, the page says so rather than quietly ignoring it.

  • mode (also type or what) — number, coin or dice, defaults to number. Which generator: a number in a range, coin flips, or dice rolls.
  • min (also from or low) — a number, defaults to 1. Smallest value, in number mode.
  • max (also to or high) — a number, defaults to 100. Largest value, in number mode.
  • count (also n, howmany or q) — a whole number from 1 to 1000, defaults to 1. How many values, flips or rolls to produce.
  • integer (also integers or wholenumbers) — true or false, defaults to true. Whole numbers only, in number mode. Turn off for decimals.
  • duplicates (also allowduplicates or repeat) — true or false, defaults to true. Allow the same value more than once. Turn off to draw without replacement — the range must then be at least as large as the count.
  • sides (also die, dice or d) — 4, 6, 8, 10, 12, 20 or 100, defaults to 6. Which die to roll, in dice mode.

The tool reads these on arrival but never writes them back, so what you type here stays out of your browser history.

How does a random number generator work?

This tool uses the browser's crypto.getRandomValues() API, which draws from the operating system's entropy source (hardware events, timing jitter, etc.). This is cryptographically secure and unpredictable, unlike Math.random() which uses a deterministic algorithm.

What is the difference between a random number and a pseudo-random number?

A true random number comes from a physical process (hardware noise, radioactive decay). A pseudo-random number is generated by a deterministic algorithm seeded with an initial value — it looks random but is reproducible. crypto.getRandomValues() uses entropy from the OS hardware, making it suitable for security applications.

Can I generate random numbers without duplicates?

Yes — enable the "No duplicates" mode. The generator uses rejection sampling to produce a uniformly distributed set of unique values across your chosen range.

What is a fair coin flip or dice roll?

A fair coin flip is 50/50 — heads or tails equally likely. A fair six-sided die gives each face a 1/6 probability. This tool uses cryptographic randomness so each outcome is unbiased and independent of previous results.

What dice notation does it understand?

NdS rolls N dice with S sides, any size from 2 to 1000 (d% is a d100), and terms add or subtract: 1d20+1d4+2. Append kh or kl to keep the highest or lowest dice, so 2d20kh1 is advantage and 2d20kl1 disadvantage; dl and dh drop them instead, so 4d6dl1 is the classic ability-score roll. Dropped dice stay visible, struck through, so you can see what was discarded.

Updated October 8, 2026