Why use a random number generator?
Random numbers show up everywhere in development and daily life:
- Testing and QA — generate random test data, seed databases, or simulate user behavior.
- Games and simulations — dice rolls, card shuffles, Monte Carlo simulations, procedural generation.
- Drawings and lotteries — pick winners, assign random groups, or select raffle numbers.
- Education — create problem sets, generate sample datasets, or demonstrate probability concepts.
- Decision making — break ties, randomize order, or select from a list without bias.
Cryptographic randomness vs Math.random()
This generator uses crypto.getRandomValues(), which is cryptographically secure. The difference matters:
- Math.random() uses a pseudo-random number generator (PRNG) seeded from a predictable source. The output looks random but can be reproduced if the seed is known.
- crypto.getRandomValues() draws from the OS entropy pool (hardware noise, user input timing, disk I/O). The output is cryptographically unpredictable.
For casual use, both are fine. For anything security-sensitive — passwords, tokens, encryption keys — always use the Crypto API. This tool uses it by default.
Features of this random number generator
- Custom range — any min/max including negative numbers and decimals.
- Batch generation — up to 10,000 numbers at once.
- Integer or decimal — choose whole numbers or decimals with 1-10 decimal places.
- Unique mode — no duplicates when you need distinct values.
- Sorting — ascending, descending, or random order.
- Multiple separators — comma, newline, space, or tab for easy pasting.
Related generator tools
- Password Generator — generate strong, secure random passwords.
- UUID Generator — create random UUIDs (v4 and v7).
- Lorem Ipsum Generator — generate placeholder text.