Skip to content

Mean, Variance, Standard Deviation: A Beginner's Guide

By Sufi Inam Ul HassanReviewed by Syeda Kinza Batool17 min readUpdated 30 September 2026

Mean, variance, standard deviation explained in plain language with one shared data set, plus the five number summary and a dedicated section on geometric mean and when it beats a plain average.

Ask for "the average" of a set of numbers and almost everyone reaches for the same operation: add them up, divide by how many there are. That single number is genuinely useful, but it also hides everything about how spread out the data actually is, and it is quietly the wrong kind of average for an entire category of real-world numbers, growth rates and ratios among them. This guide walks through the mean variance standard deviation relationship using one shared data set from start to finish, then spends real time on geometric mean, the average built for exactly the cases where the regular one misleads. Every number below can be checked directly against the statistics calculator on this site.

The shared data set for mean, variance, standard deviation

To keep every formula grounded in the same numbers rather than a new example each time, this guide uses one data set throughout: 2, 4, 4, 4, 5, 5, 7, 9. Eight values, a mix of repeats and unique numbers, small enough to compute by hand and confirm against a calculator at every step.

Mean: the familiar average

The arithmetic mean is the sum of every value divided by how many values there are. For this data set, the sum is 2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40, and there are 8 values, so the mean is 40 divided by 8, which is 5.

The mean is useful precisely because it is familiar and easy to compute, but it treats every value as equally informative, which is not always true. A single very large or very small value can pull the mean noticeably away from where most of the data actually sits, a weakness the median (the middle value once the data is sorted) does not share, since the median only cares about position, not size.

Variance: how far, on average, values sit from the mean

Variance answers a more specific question than the mean does: not "what is typical" but "how spread out is everything around that typical value." The calculation has a clear sequence of steps.

First, find each value's deviation from the mean by subtracting the mean from it. For the data set 2, 4, 4, 4, 5, 5, 7, 9 with a mean of 5, the deviations are -3, -1, -1, -1, 0, 0, 2, 4.

Second, square every deviation, which does two things at once: it makes every value positive (so positive and negative deviations cannot cancel each other out and hide real spread), and it weights larger deviations more heavily than smaller ones. Squaring -3, -1, -1, -1, 0, 0, 2 and 4 gives 9, 1, 1, 1, 0, 0, 4 and 16.

Third, add up the squared deviations. This total, 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32, is itself a named statistic, the sum of squared deviations, though it is worth keeping separate in your head from sum of squares (Σx²), a different figure that squares and sums the raw values themselves (2² + 4² + 4² + 4² + 5² + 5² + 7² + 9² = 4 + 16 + 16 + 16 + 25 + 25 + 49 + 81 = 232) rather than their deviations from the mean. Sum of squares is less a number read on its own and more a building block: variance itself, computed the standard way, and linear regression both rely on a version of it.

Fourth, divide by a count. This is where population and sample variance diverge. Population variance divides by the full count, n: 32 divided by 8 is exactly 4. Sample variance divides by one less than the count, n minus 1: 32 divided by 7 is approximately 4.5714. The smaller divisor makes sample variance come out larger, a deliberate adjustment called Bessel's correction, which exists because a sample systematically tends to sit slightly closer to its own mean than the full population would to its true mean, and dividing by a smaller number corrects that downward bias. The n minus 1 in that divisor is the degrees of freedom: once the sample mean is fixed, only n minus 1 of the values are free to vary.

Which one applies depends on what the 8 numbers actually represent. If they are the complete group you care about, for instance every employee in a small department, population variance is correct. If they are a smaller group standing in for something larger, for instance a sample of 8 customers meant to represent all customers, sample variance is the honest choice.

Standard deviation: variance back in real units

Variance's biggest practical drawback is its units: squaring the original values means variance is measured in squared units, which rarely means anything intuitive (a variance of 4 "test points squared" is not a natural quantity to picture). Standard deviation fixes this with one more step: take the square root of variance, which returns the figure to the data's original units.

For this data set, population standard deviation is the square root of 4, which is exactly 2. Sample standard deviation is the square root of approximately 4.5714, which comes to approximately 2.1381. Both describe the same underlying spread, in the same units the original data was measured in, which is why standard deviation, not variance, is almost always the number actually quoted or compared.

A standard deviation of 2, for this particular data set, means that a typical value sits about 2 units away from the mean of 5, consistent with looking at the numbers directly: most values (4, 4, 4, 5, 5) sit close to the mean, while 2 and 9 sit further out and pull the average distance up.

A related figure is the standard error of the mean. How to find standard error: divide the sample standard deviation by the square root of n, so 2.1381 divided by the square root of 8 is about 0.756. That is the SEM formula, and it shrinks as the sample grows, which is why bigger samples pin down a mean more precisely.

Range, quartiles and the five number summary

Standard deviation is not the only way to describe spread. To find the range, sort the values in ascending order and subtract the smallest from the largest; for this data set, 9 minus 2 is 7. That is how to find range in one step, and it answers how do you find the range for any list. It is easy, but it depends entirely on the two most extreme values and ignores everything between them.

Quartiles split the sorted data into four equal groups. The five number summary, also written as the 5 number summary, lists the minimum, first quartile, median, third quartile and maximum. How to find interquartile range from it: subtract the first quartile from the third, so 6 minus 4 is 2. That IQR, sometimes typed i q r, measures the spread of the middle half and barely reacts to an outlier.

Five number summary

StatisticValue
Minimum2
First quartile (Q1)4
Median4.5
Third quartile (Q3)6
Maximum9

Measures of spread

MeasureValue
Range7
Interquartile range2
Median absolute deviation0.5
Population standard deviation2
Sample standard deviation2.1381

The median absolute deviation ignores extremes even more. The distances from the median of 4.5 sort to 0.5 five times, 2.5 twice and 4.5 once, and their median is 0.5, far below the standard deviation of 2. The statistics calculator computes quartiles and the interquartile range alongside everything in this guide, using the exclusive median method.

Geometric mean: a different question entirely

Every mean variance standard deviation calculation covered so far describes the same 8-number data set from a different angle, but they all share one assumption: that adding the values together is the meaningful operation. Geometric mean drops that assumption. Instead of "sum divided by count," it computes the nth root of the product of n values, which is the right tool whenever the values in question multiply together rather than add together.

Worked example. Take the data set 1, 5, 7, 9, 12. Multiplying all five values together: 1 × 5 × 7 × 9 × 12 = 3,780. Taking the fifth root (since there are 5 values) of 3,780 gives approximately 5.194. Compare that to the arithmetic mean of the same five numbers: (1 + 5 + 7 + 9 + 12) divided by 5 is 6.8, noticeably higher than the geometric mean's 5.194. This gap is not an error in either calculation, it reflects a real mathematical fact: for any set of positive numbers that are not all identical, the geometric mean is always smaller than the arithmetic mean, and the two only ever match when every value in the set is the same.

Why the gap exists: averaging ratios and different scales

The clearest illustration of why geometric mean exists is averaging two ratings measured on different scales. Picture a car reviewed on a 0-to-5 fuel-efficiency scale and a 0-to-100 safety scale. Say a particular car scores 4 on fuel efficiency and 90 on safety. The arithmetic mean of those two numbers is (4 + 90) divided by 2, which is 47, a number almost entirely dictated by the safety score, since one point of change on the 0-to-100 scale swings the average by half a point, while one point of change on the 0-to-5 scale barely moves it at all. The larger-scale number quietly dominates a plain average, even though neither rating is inherently more important than the other.

The geometric mean of the same two scores is the square root of their product: √(4 × 90) = √360, which is approximately 18.97. This treats a given percentage change on either scale as equally significant, rather than letting whichever scale happens to use bigger numbers dominate the result. That is the general principle behind reaching for a geometric mean over an arithmetic one: whenever the values being combined come from genuinely different scales, or represent ratios and rates rather than plain counts, a geometric mean gives a fairer combined figure.

Growth rates are the other classic use case. Imagine an investment that grows 10 percent in year one and then shrinks 10 percent in year two. A naive average of "+10 percent" and "-10 percent" suggests 0 percent, breaking even. The actual outcome is different: multiplying the two growth factors, 1.10 × 0.90, gives 0.99, meaning the investment actually ended the two years down 1 percent overall, not flat. Averaging growth factors (or equivalently, taking a geometric mean of the returns) reflects that real compounding effect correctly, while an arithmetic average of the percentage changes does not.

A fuller worked example: averaging investment returns correctly

Investment returns are the single most common place a plain arithmetic mean quietly gives a misleading answer, so it is worth working through a complete example rather than just stating the rule.

Suppose an investment returns +20 percent in year one, -10 percent in year two, and +15 percent in year three. The arithmetic mean of those three percentages is (20 - 10 + 15) divided by 3, which is 8.33 percent, and it is tempting to read that as "the investment averaged 8.33 percent a year." That reading is not correct, because percentage changes do not add together the way plain numbers do, they compound, or multiply, year over year.

The correct way to average returns is to convert each one to a growth factor first (20 percent becomes 1.20, -10 percent becomes 0.90, 15 percent becomes 1.15), multiply the growth factors together, and take the geometric mean of the result. The product is 1.20 times 0.90 times 1.15, which is 1.242. The geometric mean, the cube root of 1.242 since there are three years, is approximately 1.0749, meaning an average annual growth rate of about 7.49 percent, noticeably lower than the arithmetic mean's 8.33 percent.

The gap is not a rounding artifact, it is the mathematically correct answer to a genuinely different question. Starting with $100 and applying the three actual returns in sequence, $100 becomes $120 after year one, $108 after year two, and $124.20 after year three. Applying the geometric mean's steady 7.49 percent every year for three years reproduces that exact same $124.20 ending balance, while applying the arithmetic mean's 8.33 percent every year for three years would not, since 8.33 percent is the average of the percentages, not the steady rate that actually reproduces the real compounded outcome. This is exactly why fund performance and compound annual growth figures are quoted as geometric averages, never arithmetic ones: only the geometric mean answers "what single, steady annual rate gets you from the starting balance to the actual ending balance."

Why geometric mean is undefined for some data

A geometric mean requires every value in the data set to be strictly positive, and the reason is structural rather than a limitation of any particular calculator. A single zero anywhere in the data set forces the entire product to zero, since multiplying anything by zero gives zero, which makes the "nth root of the product" collapse to zero regardless of how large the other values are, a genuinely meaningless result rather than a small one. A negative value causes a different problem: an even-numbered root of a negative product is not a real number at all, since no real number multiplied by itself an even number of times produces a negative result.

Rather than returning a nonsensical figure or a silent NaN in either case, a well-built calculator should report geometric mean as explicitly undefined whenever the data set contains a zero or a negative value, and let every other statistic (which have no such restriction) compute normally regardless. That is precisely how this site's own statistics calculator handles it: geometric mean shows as undefined for a data set containing a non-positive value, while sum, mean, median, variance, standard deviation and quartiles are all still computed and displayed.

Whichever figure sent you looking for this

A lot of these mean variance standard deviation questions come back to the same handful of tools. A mean calculator, a median calculator or a mode calculator each answer one piece of the "what is typical" question on their own. A variance calculator and a standard deviation calculator, sometimes shortened to sd calculator, sample standard deviation calculator or population version alike, answer the spread question, often building on the same sum of squares step covered above, and a mean absolute deviation calculator or a mean median mode calculator packages a few of these together, the way a standard error of mean formula or a relative standard deviation figure packages the spread question for a sample mean specifically rather than a single data set. An interquartile range calculator or quartile calculator covers the same ground as the exclusive-median method walked through here, and a plain "what is the range of a data set" question is simpler still, just the maximum minus the minimum. A geometric mean calculator answers a different question again, using a geometric mean formula rather than an arithmetic mean formula, which is exactly why comparing geometric mean vs arithmetic mean matters before deciding how to calculate a geometric mean correctly for a specific data set.

Bringing it together

Mean describes a typical value. Variance and standard deviation describe how far values typically sit from that mean, in squared and original units respectively, with a population-versus-sample choice that depends on whether the data is the whole group or a sample of it. Sum of squares is the building block those two are made from, and together the three make up the mean variance standard deviation relationship covered throughout this guide. Geometric mean answers a different question altogether: not "what is the typical value" but "what single value, multiplied by itself repeatedly, reproduces the same overall product," which is exactly the right question for growth rates, ratios and multi-scale ratings, and exactly the wrong tool for a plain list of test scores or measurements.

Run any of the numbers in this guide, the 8-value data set or the 1, 5, 7, 9, 12 geometric mean example, through the statistics calculator directly to see the identical figures appear, alongside quartiles, the interquartile range, and both population and sample versions of variance and standard deviation in a single report.

Frequently asked questions

What is the difference between variance and standard deviation?

Standard deviation is the square root of variance, nothing more. Variance is measured in squared units, which makes it hard to interpret directly (a variance of 4 square inches means little on its own), while standard deviation returns the figure to the data's original units, which is why standard deviation is the number usually quoted and variance is treated as the calculation step that gets you there.

Why do I need both population and sample standard deviation?

They answer different questions about the same numbers. Population standard deviation treats the data you have as the entire group you care about. Sample standard deviation treats it as a subset representing a larger group, and divides by one less than the count specifically to correct for the fact that a sample tends to slightly understate the true spread of the full population it was drawn from.

Why is sample standard deviation always slightly larger than population standard deviation for the same numbers?

Because sample standard deviation divides the sum of squared deviations by one less number (n minus 1) than population standard deviation does (n). Dividing the same total by a smaller number always produces a larger result, and that specific adjustment, called Bessel's correction, exists to counteract a sample's tendency to underestimate the true variance of the population it came from.

What is sum of squares actually used for?

On its own, not much: it is a building block other statistics are built from rather than a figure read in isolation. Variance is a sum of squared deviations divided by a count, standard deviation is the square root of that, and linear regression fits a line by minimizing a sum of squares. Seeing it as a separate figure mostly helps when checking a calculation by hand or verifying what a formula is actually doing internally.

Can standard deviation ever be negative?

No. Standard deviation is a square root of a sum of squared values, and both squaring and taking a square root only ever produce zero or a positive result. A standard deviation of exactly 0 means every value in the data set is identical, since that is the only way there can be no spread at all.

When should I use geometric mean instead of the regular average?

Use geometric mean whenever the values being averaged multiply together rather than add together, which covers growth rates, investment returns, and index numbers built from ratios on different scales. Use the regular arithmetic mean for values that genuinely sum in a meaningful way, like test scores or measured heights, where adding them up and dividing by the count is the natural operation.

Why does the calculator say geometric mean is undefined for some data sets?

A geometric mean needs every value to be strictly positive. A single zero in the data set forces the entire product to zero, since anything multiplied by zero is zero, which makes the result meaningless rather than merely small. A negative value is worse still, since taking an even root of a negative product does not produce a real number at all. The calculator reports the result as undefined in both cases instead of returning a wrong or NaN result.

Put this into practice with the free Statistics Calculator.