Central Limit Theorem Simulation: Watch It Work (and Fail) With Interactive Demos

By Dackohn · 2026-10-06

The Central Limit Theorem (CLT) says that the average of n random values is approximately normally distributed — centred on the true mean, with spread σ/√n — no matter what shape the original data has, as long as its variance is finite. It is the reason confidence intervals and t-tests work on messy real-world data. It is also easy to recite and hard to feel, so this walkthrough lets you watch it happen. Every number below comes from simulations of 20,000 samples, and you can reproduce them in the simulator embedded on this page.

Try it: the simulator

Pick a population, set the sample size n, and press Animate. Each sample’s mean is added to the histogram, and the dashed curve is what the CLT predicts.

Prefer a full page? Open the CLT simulator on its own.

Experiment 1: skewed data becomes a bell

Choose Skewed. This is an exponential distribution with mean 5 and standard deviation 5: most values are small and a few are large, like waiting times or incomes. At n = 1 the “means” are just single values, so the histogram is as lopsided as the population. Increase n and watch what happens:

Sample size n1530100
Spread of the means (simulated)4.922.240.910.50
CLT prediction σ/√n5.002.240.910.50
Skewness of the means (simulated)2.070.880.370.21
Share within ±1 SE (normal: 68%)87%70%68%69%

Two things happen at once. The spread shrinks exactly as σ/√n predicts: quadrupling n halves it. And the shape straightens out, with the skewness falling like 2/√n. By n = 30 the means behave like a normal distribution by the 68% test, even though no individual value does.

Experiment 2: dice

Choose Die roll. A single roll is flat: each face 1–6 has the same chance. The average of 10 rolls, however, piles up around 3.5 with a spread of about 0.54 (the CLT predicts 1.708/√10 = 0.540), and the histogram already looks like a bell. Symmetric populations need far smaller samples than skewed ones; n = 5 to 10 is usually plenty.

Experiment 3: two humps, one bell

Choose Bimodal: values cluster around 2 and around 8, and almost nothing lands in between. A single value falls between 4.5 and 5.5 only about 0.02% of the time. Yet with n = 10, about 39% of the sample means land in exactly that range. The average is most likely to sit where individual values almost never are. It is a useful reminder that the CLT is a statement about averages, not about the data.

Experiment 4: when the theorem fails

Choose Heavy-tailed. This draws from a Cauchy distribution, whose tails are so heavy that it has no finite mean or variance. Occasional enormous values dominate every average, and the mean of n Cauchy values has exactly the same distribution as a single value. In the simulations, the middle 50% of the sample means stayed about 2 units wide at n = 1, 10 and 100, and about 6% of means fell outside the plotted window every time (theory says 6.3%). More data does not help. Real data with extremely heavy tails — some financial returns, file sizes, insurance claims — can behave in a similar way, which is why medians and other robust statistics exist.

So how big does n need to be?

The “n ≥ 30” rule is a rough guide, not a law. The honest answer depends on skewness: the skewness of the mean shrinks like γ/√n, where γ is the population’s skewness. Symmetric data is fine by n = 5–10. Strongly skewed data like the exponential example needs around 30 for the 68% test to hold, and more if you care about the far tails. Data with no finite variance never gets there.

Why it matters

A confidence interval for a mean is built from the sample mean’s distribution, and the CLT is what makes that distribution normal enough to use. The confidence interval simulator shows the consequence: about 95% of intervals built this way capture the true mean. The same logic powers t-tests and A/B test calculations.

Common misconceptions

For the formulas behind all of this, see the statistics formula sheet.