random-number
A random number generator produces unbiased numeric values inside a chosen range β integers or decimals, single values or bulk lists, with optional uniqueness β drawing from a cryptographically strong source so the output is suitable for raffles, sampling, statistical tests, password seeding, and game mechanics. The ZTools Random Number Generator runs entirely in the browser using the Web Crypto API for secure randomness, supports decimal precision, exclusive/inclusive bounds, no-repeat lists, and bulk export to CSV / JSON / clipboard, with a transparent algorithm choice (crypto vs Math.random) so users know what they are getting.
Use casesβ
Raffles and giveawaysβ
Pick a winner from 1,200 entrants. Generate one integer between 1 and 1,200; the entrant at that index wins. Crypto-strong RNG eliminates "the host rigged it" suspicions.
Statistical samplingβ
Researchers sample 50 random survey IDs from a population of 5,000. Generate 50 unique integers in [1, 5000] and pull those rows from the dataset.
Game and simulation seedsβ
Game designers test rare-drop mechanics. Generate 10,000 rolls in [1, 100] and count how many fall in the rare-drop band.
Test data generationβ
Need 1,000 random prices between 9.99 and 99.99 for a stress test. Decimal output with 2-place precision feeds the seed script.
How it worksβ
- Pick the type β Integer or decimal. Decimals support 1β10 places of precision.
- Set the range β Min and max. Inclusive on both ends by default; toggle to exclusive if needed.
- Choose count and uniqueness β One value, or a bulk list (up to 10,000). Optional "no repeats" produces a sample without replacement.
- Pick the source β Crypto-strong (default, Web Crypto) or fast pseudo-random (Math.random) for non-security uses.
- Generate and export β Display as a list, copy to clipboard, or download CSV / JSON.
Examplesβ
Input: Integer 1β100, count 5
Output: 47, 12, 88, 3, 61
Input: Decimal 0.0β1.0, precision 4, count 3
Output: 0.4837, 0.0192, 0.7755
Input: Unique integers 1β1000, count 10
Output: Ten distinct integers; perfect for sampling without replacement
Frequently asked questionsβ
Is it truly random?
Cryptographically pseudo-random β indistinguishable from true random for any practical purpose. Web Crypto uses the OS entropy pool. Suitable for raffles, security seeds, and statistics.
Why offer Math.random as well?
Math.random is faster and fine for non-security uses (game prototyping, dummy data). Crypto RNG is slower per call but still generates 10,000 numbers in well under a second.
Can it produce a uniform sample without replacement?
Yes β the "no repeats" mode shuffles indices and returns the first N. Guaranteed-unique even for large counts.
How big a range can I use?
Up to JavaScript's safe integer range (β 9 quadrillion). For larger ranges, use a BigInt mode or generate two halves.
Can I seed for reproducibility?
Yes β switch to seeded mode (xoshiro256**) and supply a seed; the same seed always produces the same sequence. Useful for tests.
Is the result safe for cryptographic keys?
For 256-bit-or-less integer keys, yes. For longer secrets, prefer the Password Generator which formats the output as a passphrase or token.
Tipsβ
- For raffles, share the seed and the algorithm β anyone can reproduce the draw and verify fairness.
- No-repeats mode saves you the manual dedupe pass.
- For floats, set precision before generating β rounding after introduces tiny biases.
- Bulk-export to CSV when feeding the result into a spreadsheet or analytics tool.
- Use crypto RNG for anything user-facing; pseudo-RNG only for performance-bound prototypes.
Try it nowβ
The full random-number runs in your browser at https://ztools.zaions.com/random-number β no signup, no upload, no data leaves your device.
Last updated: 2026-05-05 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub