In statistics, s² is the symbol for sample variance. It measures how spread out the values in a dataset are from the sample mean. If you’ve seen this notation in a textbook or homework problem, it’s asking you to calculate how much individual data points differ from the average, using a specific formula designed for samples rather than entire populations.
The Formula for s²
The sample variance s² is calculated as:
s² = [Σ(xᵢ − x̄)²] / (n − 1)
Here’s what each piece means. Each xᵢ is an individual data point in your sample. The x̄ (pronounced “x-bar”) is the sample mean, or average, of all your data points. The n is the total number of data points. The Σ symbol tells you to add up everything inside the parentheses for every data point from i = 1 to n.
In plain terms, the formula asks you to find how far each value sits from the average, square those distances, add them all up, and then divide by one less than the number of data points.
How to Calculate s² Step by Step
Say you have five test scores: 78, 82, 85, 90, 95. Here’s the process:
- Find the mean (x̄): Add up all the values and divide by n. That’s (78 + 82 + 85 + 90 + 95) / 5 = 86.
- Subtract the mean from each value: You get −8, −4, −1, 4, 9. These are the deviations.
- Square each deviation: 64, 16, 1, 16, 81. Squaring ensures that negative deviations don’t cancel out positive ones.
- Add the squared deviations: 64 + 16 + 1 + 16 + 81 = 178. This total is called the sum of squares.
- Divide by n − 1: 178 / 4 = 44.5.
The sample variance s² for this dataset is 44.5. To get the standard deviation (s), you take the square root: √44.5 ≈ 6.67.
Why s² Uses n − 1 Instead of n
This is the part that trips most people up. If you’re calculating the average squared deviation, it seems like you should divide by n. And if you had data for an entire population, you would. But when you’re working with a sample, dividing by n consistently underestimates the true population variance. The smaller your sample, the worse the underestimation gets.
The fix is known as Bessel’s correction: dividing by n − 1 instead of n. Mathematically, if you divide by n, the expected value of your estimate comes out to [(n − 1) / n] × σ², which is always smaller than the true population variance σ². Dividing by n − 1 compensates for this exactly, making s² an “unbiased estimator” of the population variance. That just means if you repeated your sampling many times, s² would average out to the true value.
The intuitive reason this happens is that you’re using the sample mean x̄ as a stand-in for the true population mean μ. Since x̄ is calculated from the same data, it sits closer to your sample points than μ would, which shrinks the squared deviations. The n − 1 correction accounts for this lost “degree of freedom.” You estimated one thing (the mean) from the data before using it in the variance formula, so you effectively have one fewer independent piece of information.
s² vs. σ²: Sample vs. Population
Statistics uses a consistent convention: Greek letters refer to populations, and Latin (regular) letters refer to samples. So σ² (sigma squared) is the population variance and s² is the sample variance. You’ll see the same pattern with μ for population mean vs. x̄ for sample mean.
The population variance σ² divides by n because you have every single value in the group. The sample variance s² divides by n − 1 because you’re estimating from incomplete data. In practice, you almost always work with samples, which is why s² shows up far more often in coursework and real analysis.
When your sample size is large (hundreds or thousands), the difference between dividing by n and n − 1 becomes negligible. For small samples of 10 or 20, the correction matters quite a bit.
What the Units of s² Mean
One important detail: because you’re squaring deviations, the units of s² are squared versions of your original units. If your data is in centimeters, s² is in square centimeters. If your data is test scores, s² is in “squared points,” which isn’t very intuitive. This is the main limitation of variance as a descriptive number. It’s hard to interpret on its own because the units don’t match the original data.
That’s why the standard deviation s (the square root of s²) is more commonly reported when describing data. It brings the measurement back to the original units. Variance is more useful behind the scenes in statistical formulas and tests, where squared values simplify the math.
Where s² Appears in Statistical Tests
Sample variance isn’t just a standalone calculation. It feeds into many of the statistical tests you’ll encounter in coursework and research. In a t-test, which compares the means of two groups, s² is used to calculate the standard error and ultimately the t-statistic that determines whether a difference is statistically significant. Before running a t-test, you often need to check whether the two groups have roughly equal variances, a requirement called homogeneity of variance. If the variances are too different and the groups have different sizes, the p-value from a standard t-test becomes unreliable, and an alternative version (the Welch t-test) is used instead.
In ANOVA, which compares means across three or more groups, the entire logic revolves around comparing variance between groups to variance within groups. The sample variances from each group are pooled together to create a single estimate of within-group variability. A large ratio of between-group variance to within-group variance suggests the group means are genuinely different.
Under normal distribution assumptions, a scaled version of s² follows a chi-squared distribution with n − 1 degrees of freedom. This property is what makes confidence intervals and hypothesis tests for variance possible. It’s also why the n − 1 keeps appearing throughout inferential statistics: it carries forward as the degrees of freedom in these distributions.

