Random Number Generator
Generate cryptographically secure random integers, floats, sequences, and dice rolls — instantly and privately in your browser.
Multiple modes
Generate integers, floats, shuffled sequences, and simulate dice rolls with any number of sides and dice.
Export results
Copy numbers to your clipboard or download them as a plain text file for use in spreadsheets or scripts.
Cryptographically secure
Uses the Web Crypto API (crypto.getRandomValues) instead of predictable Math.random() for true randomness.
How to use the random number generator
Random numbers are essential for simulations, games, statistical sampling, cryptography, and testing. This tool gives you four ways to generate random values, all using cryptographically secure randomness from your browser.
- Integer mode — Set a minimum and maximum range, choose how many numbers to generate, and optionally forbid duplicates or sort the output.
- Float mode — Generate decimal numbers with configurable precision (0–15 decimal places) within any range.
- Sequence mode — Shuffle a range of numbers (e.g., 1 to 100) and pick a random subset. Perfect for lotteries and raffles.
- Dice mode — Roll virtual dice with any number of sides (D6, D20, D100, etc.) and any number of dice.
Why crypto.getRandomValues matters
Standard JavaScript Math.random() is a pseudo-random number generator seeded from the system time. It is fast but predictable — an attacker who knows the seed can reproduce the entire sequence. The Web Crypto API's getRandomValues uses the operating system's entropy pool (/dev/urandom on Unix, CryptGenRandom on Windows) to produce numbers that are suitable for cryptographic use.
- True randomness — Seeds come from hardware noise, mouse movements, and other physical entropy sources.
- Unpredictable — Even if an attacker sees previous outputs, they cannot predict future values.
- Uniform distribution — Every number in the range has an equal probability of being selected.
Frequently asked questions
›Is this random number generator free?
Yes, this random number generator is completely free to use. There are no usage limits, watermarks, or sign-ups required. All generation happens locally in your browser.
›Is my data safe when using this random number generator?
Absolutely. All random number generation is performed locally in your browser using the Web Crypto API. Your ranges, counts, and results never leave your device. No data is transmitted to any server.
›How does the random number generator work?
This tool uses your browser's built-in Web Crypto API (crypto.getRandomValues) to generate cryptographically secure random numbers. This is far more secure than the standard Math.random() function, which is predictable and unsuitable for security-sensitive applications.
›What types of random numbers can I generate?
You can generate random integers within a custom range, random floating-point numbers with configurable decimal places, random sequences of unique numbers (Fisher-Yates shuffle), and simulate dice rolls with any number of sides.
›Can I generate multiple random numbers at once?
Yes. In Integer and Float modes, you can generate up to 10,000 numbers in a single batch. In Sequence mode, the tool shuffles your entire range and picks a random subset. In Dice mode, you can roll up to 20 dice at once.
›What is the 'no duplicates' option?
When enabled in Integer mode, the generator ensures every number in the result set is unique. It uses a Fisher-Yates shuffle on the full range and picks the first N values. If you request more numbers than the range allows, generation is disabled to prevent errors.
›Can I download my random numbers?
Yes. Each generation mode includes a download button that saves the results as a plain text (.txt) file with one number per line. You can also copy the results to your clipboard with a single click.
›Is Math.random() secure enough?
No. Math.random() is a pseudo-random number generator (PRNG) that is deterministic and predictable. It is fine for games and visual effects but must never be used for passwords, security tokens, or cryptographic purposes. This tool uses crypto.getRandomValues, which is cryptographically secure.
›What is the Fisher-Yates shuffle?
The Fisher-Yates (or Knuth) shuffle is an algorithm for generating a random permutation of a finite sequence. It is unbiased, meaning every permutation is equally likely. This tool uses it for the 'Sequence' mode and the 'no duplicates' integer option.
›Can I use this for lottery or raffle draws?
Yes, the Sequence mode with a defined range (e.g., 1 to 59) and a pick count is perfect for lottery-style draws. The Fisher-Yates shuffle ensures every possible combination has an equal probability.
More free developer tools
Part of our growing tool belt — all client-side, all free.
JWT Encoder & Token Generator
Generate and sign JSON Web Tokens (HS256/384/512) locally in your browser.
Open toolRegex Generator
Build regular expressions visually with blocks, quantifiers, presets, and live match preview — all in your browser.
Open toolRegex Tester & Debugger
Test regular expressions with real-time match highlighting, capture groups, and replacement preview — all in your browser.
Open tool