Random Number Generator
Free online random number generator for integers, decimals, normal distributions, and random sampling. Perfect for statistics, simulations, and research.
Quick Generators
About Random Number Generation
- • Integers: Uniformly distributed whole numbers between min and max (inclusive)
- • Uniform: Decimal numbers with equal probability across the range
- • Normal: Bell-curve distribution using the Box-Muller transform
- • Random Sample: Select items from a list with or without replacement
How to Use the Random Number Generator
This tool generates random numbers for various statistical and practical applications. Choose from four generation modes.
Generation Types
Random Integers
Generate whole numbers within a specified range. Each number in the range has an equal probability of being selected.
Use cases:
- Rolling dice
- Lottery numbers
- Random selection
- Simulations
Uniform Distribution
Generate decimal numbers uniformly distributed across a range. Every value in the interval has equal probability density.
Use cases:
- Monte Carlo simulations
- Random sampling
- Generating random percentages
Normal (Gaussian) Distribution
Generate numbers following a bell curve distribution, clustered around a mean with specified standard deviation.
Parameters:
- Mean (μ): Center of the distribution
- Standard Deviation (σ): Spread of values
Use cases:
- Simulating test scores
- Modeling natural phenomena
- Statistical sampling
- Error simulation
Random Sample
Select items randomly from a custom list. Choose sampling with or without replacement.
Use cases:
- Drawing names from a hat
- Random assignment to groups
- Survey sampling
- Randomized order
Statistical Properties
Uniform Distribution
| Property | Value |
|---|---|
| Mean | (min + max) / 2 |
| Variance | (max - min)² / 12 |
| Std Dev | (max - min) / √12 |
Normal Distribution
| Property | Value |
|---|---|
| Mean | μ (user specified) |
| Variance | σ² |
| 68% of values | Within μ ± σ |
| 95% of values | Within μ ± 2σ |
| 99.7% of values | Within μ ± 3σ |
Common Applications
Dice Rolling
- Single die: min=1, max=6
- Two dice sum: Generate 2 numbers, add them
- D20 (role-playing): min=1, max=20
Coin Flipping
- min=0, max=1
- 0 = Tails, 1 = Heads
Card Drawing
Enter 52 cards as a list, sample without replacement
IQ Score Simulation
- Normal distribution
- Mean = 100
- Standard Deviation = 15
Exam Scores
- Normal distribution
- Mean = 75 (typical class average)
- Standard Deviation = 10-15
About Random Number Generation
True vs. Pseudo-Random Numbers
This tool uses pseudo-random number generation (PRNG), which uses mathematical algorithms to produce sequences that appear random. For most statistical applications, this is sufficient.
For cryptographic applications, use a cryptographically secure RNG instead.
Quality of Randomness
The JavaScript Math.random() function used here provides:
- Uniform distribution
- Period long enough for typical applications
- Sufficient for simulations and sampling
Reproducibility
Each generation produces different results. For reproducible simulations, consider using a seeded random number generator (not available in this tool).
Sampling Methods
With Replacement
- Items can be selected multiple times
- Each draw is independent
- Sample size can exceed population size
- Probability stays constant
Without Replacement
- Each item can only be selected once
- Draws are dependent
- Sample size ≤ population size
- Probability changes after each draw
Best Practices
For Statistical Sampling
- Define your population clearly
- Use simple random sampling when possible
- Generate more samples than needed to account for exclusions
- Document your sampling method
For Simulations
- Generate sufficient replications (often 1,000+)
- Check that results match expected distributions
- Use appropriate distribution for your model
- Consider edge cases
For Random Assignment
- Use without replacement for unique assignments
- Balance group sizes if needed
- Document the randomization for reproducibility
Related Resources
- Probability Basics - Understanding randomness
- Normal Distribution - The bell curve
- Sampling Methods - Types of sampling
- Monte Carlo Methods - Simulation techniques
Want to learn the theory?
Our lessons explain the statistical concepts behind this calculator with clear examples.
Browse Lessons →