Use this for anything that needs haphazardness: dice rolls (min=1, max=6), raffle draws (unique-only), random test data, scientific Monte Carlo simulations, randomized A/B test group assignments, lottery number picks, or just settling an argument. Every number generation uses crypto.getRandomValues — the same CSPRNG browsers use to generate cryptographic keys — so there's no biased distribution like you'd get from Math.random(). Alternative: Google's built-in RNG widget (the 'flip a coin' / 'roll a die' panel in search results) is fine for one-off casual picks, but it can't do bulk, decimals, or unique-only.
Common use cases:
**Dice roll:** min=1, max=6, count=2 → simulates rolling two dice. **Lottery numbers:** min=1, max=49, count=6, unique-only → six non-repeating picks. **Random dollar amounts:** min=9.99, max=99.99, decimals=2, count=5 → five prices. **Test data:** min=0, max=9999, count=500, output=JSON → paste into your test fixtures.
Last updated: 2026-05-11