What it does
This generator makes random numbers that follow a normal (Gaussian) distribution, the bell curve, with the mean and standard deviation you choose. Use it to make test data, simulate measurements such as heights or test scores, or show students what a normal sample looks like. Below the numbers you get a check: the sample's own mean and standard deviation, and how many values landed within 1 and 2 standard deviations.
How it's calculated: the Box–Muller transform
Take two independent uniform random numbers U₁ and U₂ between 0 and 1. Box and Muller (1958) showed that
are two independent standard normal numbers (mean 0, standard deviation 1). Each one is then scaled to your settings:
The uniform numbers are built from 53 random bits from your browser's cryptographic generator, and U₁ is never exactly 0, so ln U₁ is always defined.
The sample statistics are worked out from the rounded numbers you see, so you can paste them into a spreadsheet and get the same answer. The sample standard deviation divides by n − 1:
Worked example
With μ = 100 and σ = 15 (the scale used for many IQ tests), about 68.27% of values fall between 85 and 115, about 95.45% between 70 and 130, and about 99.73% between 55 and 145. With 20 numbers, your sample mean will usually be within 15 ÷ √20 ≈ 3.35 of 100. That figure is the standard error. A sample of 1,000 narrows it to about 0.47.
| Range | Share of a normal distribution |
|---|---|
| μ ± 1σ | 68.27% |
| μ ± 2σ | 95.45% |
| μ ± 3σ | 99.73% |
Limitations
- A small sample won't look like a perfect bell curve. Its mean and standard deviation will differ from μ and σ by chance, and that's expected.
- Normal numbers can be any size, so a few may fall far from the mean. If your quantity can't be negative, such as weight, a normal model may not fit when σ is large compared with μ.
- Up to 10,000 numbers at a time, rounded to 0 to 10 decimal places.