Random Number Generator
Three modes: generate a single random number in any range, generate a list of multiple random numbers, and simulate dice rolls or coin flips. Each click produces new random results.
You might also need
How It Works
Enter minimum and maximum values (both inclusive). Click Generate. A uniformly distributed random integer appears. Each click is independent — previous results do not influence future ones. For a number between 1 and 1000: every integer has exactly the same 1/1000 probability.
P(any value) = 1/(max−min+1) for integersMin=1, Max=100 → any integer from 1 to 100 equally likelySet range, count, and type (integer or decimal). The calculator generates the requested quantity. For Count=10 in range 1–50: generates 10 random integers, each independently drawn. Decimals mode gives uniform random values between min and max with fractional precision. Results can repeat (sampling with replacement).
Each value: uniform in [min, max], independent drawsCount=5, Range 1–100 → five independent random integersSelect die type: d4 (1-4), d6 (1-6), d8 (1-8), d10 (1-10), d12 (1-12), d20 (1-20). Enter number of dice and click Roll. All dice roll simultaneously — total and individual results display. Coin flip: select Coin, enter count. Shows sequence (H,T,H,H...) and tally.
d6: uniform over 1-6 | 2d6: sum ranges from 2 to 122d6 → each die 1-6, sum shown | Coin×10 → H:6, T:4Math.random() generates values uniformly — each outcome is equally likely. For a fair d6, each face appears with probability 1/6 over many rolls. In practice, short sequences show clustering (3,3,3,5) — this is normal random variation, not bias. Over thousands of rolls, the distribution approaches uniform.
Uniform: P(each value) = 1/(max−min+1)Roll d6 ×1000 → each face ≈166-167 timesBoth minimum and maximum accept negative values. Min=−50, Max=50: generates integers from −50 to +50, including zero. Min=0, Max=1 with Decimal mode generates numbers like 0.473, 0.821 — standard uniform(0,1) distribution. Custom ranges let you model any real-world scenario.
Supports any min ≤ max, including negative valuesMin=−10, Max=10 → integers from −10 to 10 uniformlyQuick Reference
Verify these in the calculator above.
Single
Random 1–100
Any integer equally likely
Dice
Random 1–6 (d6)
Fair die result
Dice
2d6 range
2 to 12
Probability
P(any value 1-100)
1% each
Coin
Coin flip
H or T, 50/50
Coin
10 coin flips
Sequence + tally
Decimal
Min=0, Max=1, Decimal
Uniform(0,1)
Custom
Negative range −10 to 10
Any integer included
Tips & Shortcuts
Each click of Generate is completely independent — past results do not affect future ones. Getting 7 five times in a row doesn't make 7 less likely on the next roll.
For lottery simulation: set range to match your lottery (1-49 for a 6/49 game) and generate 6 numbers. Note: repeats are possible in default mode.
Dice & Coin mode shows each individual die result alongside the total — useful for games where individual die values matter (Yahtzee, D&D advantage/disadvantage)..
For random sampling without replacement (no repeats): use a shuffle approach — generate more numbers than needed and take the first unique values.
Decimal mode with Min=0 Max=1 produces the standard uniform(0,1) distribution — foundational for Monte Carlo simulations and statistical sampling.
Common Mistakes
Expecting no repeats by default
The Multiple Numbers mode generates independent draws — repeats are possible. For 5 numbers from 1-10, you might get [3,7,3,9,3]. To avoid repeats, select a range wider than your count or use shuffle logic.
Thinking past results affect future ones
Each random number is generated independently. After rolling 6 sixes in a row, the probability of the next six is still 1/6. The generator has no memory — the "gambler's fallacy" does not apply.
Using this generator for security or cryptography
Math.random() is a pseudorandom number generator — predictable if the seed is known. For password generation, encryption keys, or any security application, use a cryptographically secure source (window.crypto.getRandomValues in browsers).
Setting min greater than max
The minimum must be less than or equal to the maximum. Min=10, Max=5 is invalid. The calculator shows an error — swap the values to fix it.
Interpreting uniform distribution as "spread out"
Uniform means each value is equally probable — not that results spread evenly. A short sequence of 5 rolls can easily give [4,4,7,4,9] — clustering is expected and normal in small samples.
Frequently Asked Questions
Select Single Number mode, set minimum to 1 and maximum to 100, and click Generate. Each click produces a new uniformly distributed random integer in that range.
Switch to Dice & Coin mode. Select the die type (d4, d6, d8, d10, d12, d20) and the number of dice. Click Roll. The result shows each die's value and the total. For a standard d6: generates a random integer from 1 to 6.
In Multiple Numbers mode, set the range and count. The calculator generates the requested count of random numbers. For truly unique values (no repeats), the numbers are drawn without replacement from the range — equivalent to shuffling and picking the first n.
The generator uses JavaScript's Math.random(), which produces pseudorandom numbers via a deterministic algorithm seeded by system entropy. It is cryptographically not suitable for security applications but statistically suitable for games, simulations, sampling, and education.
Switch to Dice & Coin mode and select Coin. Click Flip. The result shows Heads or Tails with equal probability. Multiple flips show the sequence and count of each outcome.
The minimum and maximum values define the range. Both endpoints are included (inclusive). For min=1 max=10: any of the 10 values from 1 to 10 can appear. Negative ranges work too: min=−50, max=50 generates values from −50 to +50.
Yes — in Multiple Numbers mode, switch from Integer to Decimal. The result includes decimal values uniformly distributed in the specified range.
Related Calculators
Password Generator
Generate strong, random passwords with custom settings.
Time Subtraction Calculator
Subtract one time from another to find the difference.
Reading Time Calculator
Estimate how long it takes to read any text or book.
Scientific Calculator
Full scientific calculator with trig, log, and advanced functions.
Basic Calculator
Fast arithmetic: add, subtract, multiply, divide.
Number Sequence Calculator
Find the nth term of arithmetic or geometric sequences.