🎲 Number Generator Settings

No duplicates (unique numbers only)
Sort results in ascending order

📜 Generation History

No history yet. Generate some numbers!

🎯 Roll the Dice

Click any die or button to roll. Supports D4, D6, D8, D10, D12, D20, D100.

⚡ Quick Roll Presets

🪙 Flip a Coin

🪙
Click to flip!

or press Space

0
Heads
0
Tails
0
Total Flips
0%
Heads %

📋 Random Item Picker

Enter items one per line. The picker will randomly select from your list.

⚡ Quick List Templates

📐 How Random Numbers Work

Basic Random Integer

JavaScript's Math.random() returns a float between 0 (inclusive) and 1 (exclusive). We scale it to any range.

Math.random() → [0, 1)

Random Integer (min to max):
Math.floor(Math.random() × (max − min + 1)) + min

Random Decimal

Random Decimal = Math.random() × (max − min) + min
Rounded to N places: parseFloat(num.toFixed(N))

Unique Numbers (No Duplicates)

To generate unique numbers, we use a Fisher-Yates shuffle on a range array and take the first N elements.

1. Create array [min, min+1, ..., max]
2. Fisher-Yates Shuffle:
for i from n-1 downto 1:
j = random integer from 0 to i
swap array[i] and array[j]
3. Return first N elements

Coin Flip

result = Math.random() < 0.5 ? "Heads" : "Tails"
Probability: exactly 50% for each outcome

Dice Roll (D-N)

D-N roll = Math.floor(Math.random() × N) + 1
Range: always 1 to N (inclusive)

Is Math.random() Truly Random?

Math.random() is a pseudo-random number generator (PRNG) — it uses an algorithm (typically xorshift128+) seeded by the current time. For cryptographic purposes, use crypto.getRandomValues() instead.

// Cryptographically secure version:
const arr = new Uint32Array(1);
crypto.getRandomValues(arr);
const random = arr[0] / 0xFFFFFFFF;

❓ Frequently Asked Questions

🤖
AI Insights — Coming Soon!
AI-powered pattern analysis, lucky number prediction, and probability insights.
Coming Soon — Stay Tuned!