Random Number Generator
Generate random integers or decimals in any range, with unique-number mode, sorting, and instant copy.
Last Updated: April 2026
Not for Cryptographic Use
This generator uses the browser crypto API when available and falls back to Math.random() only when needed. It is suitable for games, sampling, education, and general tools. Do not use this interface for cryptographic keys, secure tokens, passwords, or security-sensitive workflows that require audited key management.
Reviewed For Methodology, Labels, And Sources
Every CalculatorWallah calculator is published with visible update labeling, linked source references, and founder-led review of formula clarity on trust-sensitive topics. Use results as planning support, then verify institution-, policy-, or jurisdiction-specific rules where they apply.
Reviewed By
Jitendra Kumar, Founder & Editorial Standards Lead, oversees methodology standards and trust-sensitive publishing decisions.
Review editor profileTopic Ownership
Sales tax and tax-sensitive estimate tools, Education and GPA planning calculators, Health, protein, and screening-formula pages, Platform-wide publishing standards and methodology
See ownership standardsMethodology & Updates
Page updated April 2026. Trust-critical pages are reviewed when official rates or rules change. Evergreen calculator guides are checked on a recurring quarterly or annual cycle depending on topic volatility.
How to Use This Calculator
Step 1: Set the range
Enter a minimum and maximum value to define the number range.
Step 2: Choose count and type
Select how many numbers to generate and whether to use integers or decimals.
Step 3: Enable options
Toggle unique numbers (no repeats) or sort ascending if needed.
Step 4: Click Generate
Results appear instantly. Click Regenerate for a new set or Copy all to export.
How This Calculator Works
The generator takes a minimum, maximum, count, and type setting. For integers, it samples uniformly from every whole number between the two bounds, including both endpoints. For decimals, it samples uniformly from the values available at the selected precision, so a 2-decimal result is drawn from cent-level steps.
When unique mode is active for integers, small and dense ranges use the Fisher-Yates algorithm. Large sparse ranges use efficient sampling without building an enormous pool first. In both cases, each selected integer appears at most once.
Sort mode orders the final numbers from smallest to largest after generation. It does not change which numbers were produced — only their display order. Statistics (sum, average, min, max) are computed from the generated list regardless of sort setting.
What You Need to Know
Pseudorandom vs. true random
Most software random number generators, including this one, are pseudorandom. They use browser-provided random APIs to produce values that look unpredictable and uniform for ordinary use. When the browser crypto API is available, the random bytes come from the platform's cryptographic random source; otherwise the tool falls back to a standard pseudorandom API.
True random number generators use physical entropy sources such as electronic noise, radioactive decay, or atmospheric turbulence. They are not deterministic. For everyday uses — games, sampling, education, shuffles — pseudorandom generators are indistinguishable from true random in practice. For cryptographic key generation and high-stakes security, a hardware-backed CSPRNG is the appropriate choice.
| Term | Definition | Example |
|---|---|---|
| Browser crypto RNG | Random values from the browser cryptography API | Used when available for stronger random draws |
| Pseudorandom fallback | Algorithmically generated sequences that pass statistical randomness tests but are determined by a seed | Fallback behavior if browser crypto is unavailable |
| True random | Randomness derived from physical entropy sources (hardware noise, atmospheric data) | Required for cryptography or high-stakes security applications |
| Seed | A starting value that determines an entire pseudorandom sequence | Same seed always produces same sequence in seeded PRNGs |
| Uniform distribution | Every number in the range has an equal probability of being selected | The target distribution for each generated range |
| Unique (without replacement) | Each value can appear at most once in the output | Enabled with the unique toggle; uses Fisher-Yates shuffle |
Common use cases
Random number generators serve a broad set of practical needs, from classroom activities to statistical simulations. Understanding what options to set makes results more useful for each context.
| Use case | Setup | Recommended options |
|---|---|---|
| Lotteries and raffles | Generate unique random integers within a ticket number range | Enable unique mode; set count to picks needed |
| Classroom games | Pick random students or questions without repeats | Enable unique numbers; set max to class or question count |
| Statistical sampling | Select random indices for a data sample | Set range to dataset size; enable unique mode |
| Dice simulation | Simulate one or many dice rolls | Set min to 1, max to 6 (or 4, 8, 10, 12, 20 for RPG dice); set count |
| Random data for testing | Fill fields with test values | Set range and decimal precision; generate a batch |
| Password seed | Get random numbers for passphrase construction | Use decimal or large integer ranges with high count |
The Fisher-Yates shuffle for unique numbers
Generating unique numbers without bias requires a fair shuffle, not repeated rejection sampling. Rejection sampling — drawing a number and discarding repeats — can take many attempts when the range is close to the count, making it slow and non-uniform if not carefully bounded.
The Fisher-Yates shuffle starts with a pool of all integers in the range, then iterates from the last position to the first. At each step, it swaps the current element with a randomly chosen element at or before it. This guarantees every permutation is equally likely and runs in linear time regardless of count.
After selecting the unique values, the generator shuffles the result before display unless you choose sorted output. This is why the count cannot exceed the number of integers in the range when unique mode is on. If your range has 50 integers and you request 50, you get all of them in random order. If you request 51, there are no valid unique draws left.
Decimal precision and range behavior
When decimal mode is active, the generator converts the range to integer steps at the selected precision. For 2 decimal places with a range of 1 to 10, outputs like 3.47, 8.12, or 1.00 are all valid. Unique mode is not enforced for decimals because exact repeats are statistically negligible in normal ranges.
For very large ranges (for example, 1 to 1,000,000) or very small ranges combined with high decimal precision, the distribution remains uniform. The generator simply scales Math.random() linearly and rounds. There is no clustering or bias toward round numbers.
Using results effectively
Use the Copy all button to transfer the generated list to a spreadsheet or text editor. Numbers are separated by newlines, making them easy to paste into a single column. For large batches, the numbered list view makes it easy to reference specific positions.
The summary statistics (sum, average, smallest, largest) update with each generation. These can be useful for sanity-checking the output or for quickly calculating aggregate values from a sample. For deeper analysis, paste the numbers into the statistics calculator.
Keep the research moving with Scientific Calculator, Statistics Calculator, Percentage Calculator, and Fraction Calculator.
Frequently Asked Questions
Related Calculators
Scientific Calculator
Full-featured scientific calculator for arithmetic, powers, roots, trig, and logarithms.
Use Scientific CalculatorStatistics Calculator
Compute mean, median, mode, standard deviation, and variance from a data set.
Use Statistics CalculatorPercentage Calculator
Find percentages, percent change, and reverse percentages for quick calculations.
Use Percentage CalculatorFraction Calculator
Add, subtract, multiply, and divide fractions with step-by-step solutions.
Use Fraction CalculatorMath Calculators
Browse the full math hub for algebra, statistics, and number tools.
Use Math CalculatorsSources & References
- 1.MDN Web Docs — Crypto.getRandomValues()(Accessed April 2026)
- 2.MDN Web Docs — Math.random()(Accessed April 2026)
- 3.NIST Randomness Beacon(Accessed April 2026)
- 4.Wikipedia — Fisher-Yates shuffle(Accessed April 2026)