Skip to content

Central Limit Theorem Simulator

Pick a population, a sample size n and a number of samples, and see the distribution of the sample means form — with the normal curve the theorem predicts drawn over it and the theory set beside what your run produced. Seeded, so a picture can be reproduced; animate it on demand. Runs in your browser — nothing is uploaded. Free, no sign-up.

From 1 to 1,000. Try 1, then 5, then 30, then 100.

Quick sample sizes

From 10 to 20,000. Samples × n can be at most 2,000,000 draws.

The same seed always gives the same picture. Any text works.

Results

1,000 samples, each the mean of 30 draws from this population — 30,000 random draws in all. Seed: 2024.

The population

Population mean μ = 1, standard deviation σ = 1, skewness 2.

The sample means

1,000 sample means (n = 30 each). The curve is the normal distribution the theorem predicts: mean 1, standard error 0.1826.

1 sample mean lies beyond four standard errors and is not drawn.

What the theorem predicts against what this run produced
MeasureTheoryThis run
Mean of the sample means (μ)11.008
SD of the sample means (σ/√n)0.18260.1835
Skewness of the sample means0.36510.3448
Means within ±1.96 SE (normal: 95%)95.0%95.1%

At n = 30 the predicted skewness of the sample means is 0.365: still visibly skewed, so the normal curve is only a rough fit. A larger n brings it closer.

This is an illustration, not a proof. With a finite number of samples the bars wobble by a few percent around the curve, and a different seed shifts them again.

How to Use the Central Limit Theorem Simulator

  1. 1. Choose a population. Start with the right-skewed one, then try the very skewed, bimodal and yes/no populations, whose shapes look nothing like a bell.
  2. 2. Set the sample size n. Each sample is n random draws averaged into one number. Use the quick buttons to step n through 1, 5, 30 and 100 and watch the histogram change.
  3. 3. Set the number of samples. Each sample contributes one mean to the histogram. More samples make the picture smoother, but they do not change how normal the sampling distribution really is — only n does that.
  4. 4. Animate, or change the seed. The animation adds the samples a few at a time, only when you press the button. The same seed always reproduces the same picture; "New random seed" picks a different one.

What the Central Limit Theorem Says

Draw n independent values from any population with a finite mean μ and a finite standard deviation σ, and average them. As n grows, the distribution of that average approaches a normal distribution with mean μ and standard deviation σ/√n — the standard error — whatever shape the population has. The population does not become normal; the distribution of the sample means does.

How fast depends on the population. A symmetric population gets there quickly, a skewed one slowly. The skewness of a sample mean is the population's skewness divided by √n, so the simulator's table can predict it before you run anything:

Predicted skewness of the sample mean (population skewness ÷ √n)
Populationn = 1n = 5n = 30n = 100
Normal or uniform0000
Yes/no (p = 0.2)1.5000.6710.2740.150
Right-skewed (exponential)2.0000.8940.3650.200
Very right-skewed (lognormal)6.1852.7661.1290.618

Skewness is not the whole story: the bimodal population has skewness 0 and still takes several draws per sample before its two humps merge into one. The common rule "n of 30 or more is enough" suits moderately skewed data; the lognormal population still has a noticeable skew at n = 100. The simulator marks a fit as close once the predicted skewness falls below 0.25 — a rough guide, not a theorem.

Worked Example: Skewed Population, n = 30

With the default settings — the exponential population (μ = 1, σ = 1), n = 30, 1,000 samples, seed 2024 — the theorem predicts a standard error of 1/√30 = 0.1826 and a skewness of 0.3651. This run's 1,000 sample means have a mean of 1.008, an SD of 0.1835 and a skewness of 0.3448, and 95.1% of them lie within 1.96 standard errors of 1, against the 95% a normal curve would give.

The numbers sit close to theory but not on it, and they should not: 1,000 samples is a finite run. The run made 30,000 random draws in all; a different seed shifts every bar a little. The residual skewness is real, too — at n = 30 the means of an exponential population are still a touch right-skewed, which is why the simulator calls the normal curve a rough fit here.

From the simulation to the formulas

The standard error σ/√n is what the Standard Error Calculator and the Sampling Distribution Calculator compute from your own numbers; the normal areas come from the Normal Distribution Calculator.

Frequently Asked Questions

What does the central limit theorem say in plain words?
Averages of many independent observations are approximately normally distributed, even when the individual observations are not. The average of n values from a population with mean μ and standard deviation σ has mean μ and standard deviation σ/√n, and its distribution looks more like a bell curve as n grows.
How large does the sample size need to be?
There is no single number. For roughly symmetric populations n of 10 to 15 can do; for moderately skewed ones n of 30 is the usual rule; for heavily skewed ones (like the lognormal here) n of 100 or more may be needed. Run the simulator on a population like yours and look at the histogram.
Does the theorem make the population normal?
No. The population keeps its shape. What approaches normality is the distribution of the sample mean, which is why t-tests and confidence intervals for a mean work reasonably well on moderately non-normal data once n is not small.
Why is my simulated standard deviation not exactly σ/√n?
Because the run is a finite sample of sample means. With 1,000 samples the simulated SD typically lands within a few percent of the theoretical standard error; increase the number of samples to tighten it. A different seed gives a slightly different value each time.
Does the central limit theorem always work?
Not when the population has no finite variance, as with the Cauchy distribution, whose sample mean is as variable as a single observation. It also assumes independent draws; correlated data, such as repeated measures on one person, converge more slowly or not at all.
What does the seed do, and is the randomness real?
The draws are pseudo-random numbers generated from your seed, so the same seed, population, n and number of samples always give the identical picture — useful for sharing an example. "New random seed" chooses a seed with your browser's secure random generator. Everything runs in your browser; nothing is uploaded.

Related Tools

More in Statistics Calculators

See all Statistics Calculators