Formula & Calculator

Sample Variance

Sample variance estimates the population variance from a sample of data. It is almost the same as population variance, but you divide by (n-1) instead of n. This is called Bessel's correction. It makes the estimate unbiased: without it, sample variance tends to underestimate the true population variance, especially for small samples. For example, with a sample of 5 measurements, you divide the sum of squared deviations by 4, not 5. It is the standard measure of spread in most statistical work.

Statistics Descriptive Statistics Spread
VORZEP · DESCRIPTIVE STATISTICS TOOLS

Sample Variance Calculator

Solve the classic sample variance relation s² = Σ(xᵢ − x̄)² / (n − 1) for any of its three unknowns — sample variance, sum of squared deviations, or sample size — with step-by-step math, a live deviation schematic, and a full dataset analyzer that computes variance, standard deviation, standard error, and confidence intervals from pasted data.

s² = Σ(xᵢ − x̄)² / (n − 1)
Solve for
Sample Variance (s²) The sample variance is the average of the squared deviations from the sample mean, divided by n − 1 (Bessel's correction) rather than n. This makes it an unbiased estimator of the population variance σ². Expressed in squared units of the data. Typical: a few units² for tightly-clustered measurements, hundreds to thousands for exam scores, billions for income distributions. The sample standard deviation s = √s² restores the original units.
units²
Sample variance must be greater than zero.
= 100.00 units² · s = 10.000 units · SE = —
Sum of Squared Deviations (SS) Also written Σ(xᵢ − x̄)² or SST (total sum of squares). The numerator of the sample variance. It measures total squared deviation from the sample mean, in squared units of the data. Note SS ≥ 0 always, with SS = 0 only when all data values are identical. For a dataset of n = 10 values with s² = 100, SS = 900.
units²
Sum of squares must be greater than or equal to zero.
= 900.00 units² · with n = 10 → s² = 100.00
Sample Size (n) The number of observations in the sample. Must be an integer ≥ 2 for the sample variance to exist (n − 1 ≥ 1). Typical: 5–20 for quick pilot studies, 30–100 for routine experiments, 500–2,000 for surveys and clinical trials. As n grows, the sample variance approaches the population variance, and the standard error of the mean s/√n shrinks — larger samples give more precise estimates.
observations
Sample size must be an integer ≥ 2.
= n = 10 · df = n − 1 = 9 · SE multiplier 1/√n = 0.3162
Sample Mean (x̄) — optional The sample mean, not required to compute s², but used here for derived statistics such as the coefficient of variation (CV = s/|x̄|). Enter 0 if you do not have a mean. The CV is only meaningful for positive, ratio-scale data.
units
Mean must be a finite number.
= x̄ = 100.000 · CV = s/x̄ = 0.1000 = 10.00 %
SAMPLE VARIANCE (s²)
100.00 units²
s = 10.000 units · SS = 900.00 · n = 10 · df = 9
MODERATE SPREAD — SAMPLE-SCALE VARIANCE
s² = Σ(xᵢ − x̄)² / (n − 1)
Step-by-step solution
Sample data and mean — deviation spread
Sample points (illustrative) Mean x̄ ±1 standard deviation
Squared deviations (xᵢ − x̄)² per observation
Squared deviation per point Mean of squared deviations = s²
Sensitivity
Companion statistics
Deviations from the mean — live schematic
DEVIATIONS FROM THE MEAN · s² = Σ(xᵢ − x̄)² / (n − 1) value x → x̄ = 100 n = 10 SS = 900.00 s² = 100.00 s² = SS / (n − 1) = 900.00 / 9 = 100.00
Sample mean x̄ — the center of all deviations Positive deviation (xᵢ > x̄) ±1 standard deviation band around the mean
Each horizontal arrow is one deviation (xᵢ − x̄); its length is |xᵢ − x̄| and its color encodes the sign. The variance is the average of the squared lengths, scaled by n − 1.
What the sample variance really measures
s²sample variance
=
Σ(xᵢ − x̄)²sum of squared deviations
÷
n − 1degrees of freedom

Why divide by n − 1 and not n?

Using n − 1 instead of n corrects a systematic bias. The sample mean x̄ is itself computed from the data, so the deviations xᵢ − x̄ are slightly smaller than the deviations from the true (unknown) population mean μ. Squaring and summing them underestimates the population variance. Dividing by n − 1 inflates the estimate by just the right amount to make it unbiased: E[s²] = σ². This is called Bessel's correction. Dividing by n gives the population variance σ² (used when your data are the entire population, not a sample from it).

Variance has squared units

Because each term (xᵢ − x̄)² is squared, the sample variance is measured in squared units of the original data. If your data are in metres, the variance is in m². If in dollars, then dollars². This makes variance awkward to compare directly with the mean. The sample standard deviation s = √s² fixes this by restoring the original units, and for that reason s is almost always reported alongside or instead of s². The variance, however, is more mathematically tractable — it adds linearly for independent variables, which is why it appears throughout statistical theory.

Larger samples give more stable estimates

The sample variance s² is itself a random variable: different samples of the same size n from the same population give different values of s². The sampling variability of s² depends on the underlying distribution; for normal data, Var(s²) = 2σ⁴/(n − 1), so the standard error of s² falls as 1/√(n − 1). This is why small samples give unstable variance estimates — the value of s² could easily be twice or half the true σ². As n grows, s² concentrates around σ², and for n ≥ 30 it is usually reliable enough for most practical work.

Sensitive to outliers

Because each deviation is squared before being summed, a single data point far from the mean contributes enormously to SS and hence to s². A point at 10 standard deviations from the mean contributes 100 to the sum of squares — a hundred times more than a point at 1 standard deviation. This makes the sample variance (and the standard deviation) highly sensitive to outliers. For skewed data or data with suspected outliers, robust alternatives such as the interquartile range, median absolute deviation, or the M-estimators of scale are preferable.

How to Use This Calculator

The sample variance formula links three quantities: s², SS and n. Pick which one you want the tool to solve, then fill in the other two. The optional mean x̄ unlocks the coefficient of variation and related statistics.

1. Choose what to solve for

Pick s², SS or n from the toggle. The calculator rearranges s² = SS/(n − 1) for whichever quantity you select, using direct algebra in every case.

2. Use realistic presets

Variance presets span 0.01 to 10,000 units². Sum-of-squares presets span 1 to 1,000,000. Sample-size presets run from 2 to 1,000. The mean preset defaults to 100 but can be set to any value.

3. Match units carefully

s² and SS are in squared units of the data (m², dollars², etc.). n is a dimensionless integer count. x̄ is in the data's original units. All sliders use logarithmic mapping for the large-range quantities and linear for n and x̄.

4. Read the result and verdict

The result card shows the solved value plus its square root s, the population variance σ² = SS/n, the standard error s/√n, and a color-coded verdict classifying the spread from negligible to extreme.

5. Check the schematic and chart

The schematic shows illustrative data points around the mean, with arrows for each positive deviation and a shaded band for ±1 standard deviation. The result-card chart plots sample data on a number line with the mean and ±1σ band overlaid.

6. Analyse a dataset

Scroll to the dataset analyzer, paste any comma- or space-separated numbers, and the tool computes count, mean, sum of squares, sample variance, sample standard deviation, standard error, and a 95 % confidence interval in one step.

What This Tool Offers

Built around the classic sample variance formula, the foundation of descriptive statistics and inferential testing.

Three-way solving

Solve for sample variance, sum of squared deviations, or sample size. All rearrangements are direct algebra — no numerical methods needed.

Live deviation schematic

A scatter of illustrative data points around the mean, with deviation arrows colored by sign and a shaded ±1σ band showing where most data lie.

Spread-class verdict

Each result is classified from negligible (s² < 1) through moderate and large to extreme (s² > 10,000), with a colored badge.

Two comparison charts

A number-line chart of illustrative sample data with mean and ±1σ band, plus an advanced bar chart of squared deviations per observation.

Full dataset analyzer

Paste any list of numbers and the tool computes n, mean, SS, s², s, σ², σ, standard error, and 95 % CI in a single step.

Reference tables

A dynamic variance lookup grid, typical variance values by domain, and a full variable reference table with degrees-of-freedom notes.

Dataset Analyzer & Reference Tables

Paste a list of numbers to compute sample variance, or use the lookup grid to see how s² varies with SS and n.

Quick dataset analyzer — sample variance from pasted data

Enter any comma-, space-, or newline-separated numbers. The tool returns count, mean, SS, s², s, σ², σ, standard error, and a 95 % confidence interval. Non-numeric tokens are ignored.

Paste numbers above and click Analyze to compute the sample variance.

Sample variance lookup — s² = SS / (n − 1)

Rows are sum of squares SS, columns are sample size n. Values in squared units.

SS \ nn = 2n = 5n = 10n = 30n = 100n = 1000

Typical Sample Variances by Domain

Representative examples to help calibrate the magnitude of s² for your data.

Contexts (units)s² (units²)Notes
Precision machining (length)0.005 mm2.5×10⁻⁵ mm²Very tight tolerance
Sensor noise (voltage)0.02 V4×10⁻⁴ V²Peak-to-peak ≈ 6σ
Daily temperature (temperate)4 °C16 °C²Across a month
Exam scores (single class)10 pts100 pts²Typical for 30 students
Adult human height0.07 m0.0049 m²Very narrow distribution
Blood pressure (systolic, adults)15 mmHg225 mmHg²Population spread
Household income (US)$40,000$1.6×10⁹Right-skewed; huge variance
Daily stock return (S&P 500)1.1 %1.21 %²Annualised volatility ≈ 17 %
Reaction yield (batch)3 %9 %²Process control
Batch weight (food packaging)5 g25 g²Regulatory tolerance
Latency (network, ms)45 ms2,025 ms²Heavy-tailed distribution
Particle size (powder)15 µm225 µm²Laser diffraction

Variable Reference

SymbolMeaningTypical rangeUnits
s²Sample variance0 – 10⁹data units²
sSample standard deviation = √s²0 – 10⁴data units
SSSum of squared deviations0 – 10¹²data units²
nSample size2 – 10⁶integer count
n − 1Degrees of freedom1 – 10⁶dimensionless
x̄Sample meanany realdata units
σ²Population variance = SS/n0 – 10⁹data units²
SEStandard error of the mean = s/√n0 – 10⁴data units
CVCoefficient of variation = s/|x̄|0 – 10dimensionless
CI₉₅95 % confidence interval half-width ≈ 1.96·SE0 – 10⁴data units

What Does s² = Σ(xᵢ − x̄)² / (n − 1) Measure?

The sample variance is the fundamental measure of how spread out a set of observations is around its mean. It answers the question: on average, how far is a typical observation from the center? Unlike the range, which looks only at the two extremes, the variance uses every observation in the sample. It is the square of the standard deviation, and it appears in nearly every formula in inferential statistics — t-tests, ANOVAs, confidence intervals, regression standard errors, and the sampling distribution of the mean all depend on it.

Sample Variance Formula

The defining relationship is:

s² = Σ(xᵢ − x̄)² / (n − 1)

where the sum runs over every observation xᵢ, and x̄ is the sample mean. The quantity Σ(xᵢ − x̄)² is often abbreviated SS (sum of squares), so the formula can be written compactly as:

s² = SS / (n − 1)

Rearranged to solve for the other two unknowns:

SS = s² · (n − 1)
n = SS / s² + 1

Two related quantities appear throughout statistics. The population variance σ² divides by n instead of n − 1 and is used when your data are the entire population:

σ² = SS / n

The standard deviation s = √s² restores the original units, and the standard error of the mean SE = s/√n measures the precision of the sample mean as an estimate of the population mean.

Sample Variance Variables

SymbolMeaningNotes
s²Sample varianceUnbiased estimator of σ²; units are data units squared
sSample standard deviation√s²; same units as the data
SSSum of squared deviationsΣ(xᵢ − x̄)²; the numerator of s²
nSample sizeInteger ≥ 2; number of observations
n − 1Degrees of freedomBessel's correction; makes s² unbiased
x̄Sample meanCenter of the deviations; not needed for s² alone
σ²Population varianceSS/n; used when data are the entire population
SEStandard error of the means/√n; measures precision of x̄
CVCoefficient of variations/|x̄|; dimensionless relative spread

How Each Variable Affects the Sample Variance

The formula is a ratio: s² = SS/(n − 1). The numerator SS measures total squared deviation, so larger scatter around the mean directly increases s². The denominator n − 1 measures how many independent pieces of information went into estimating the mean; larger samples divide the same total scatter across more degrees of freedom, so s² shrinks for a given amount of scatter. In practical terms, adding more data points usually increases SS (because each new point adds its own squared deviation) but at the same time increases n − 1. Which effect dominates depends on the new point's distance from the mean: a point near x̄ adds little to SS and slightly reduces s², while a point far from x̄ adds a lot to SS and increases s².

The variance is not linear in any individual data value, because it depends on the mean, which itself is a function of all the data. This is why robust statistics prefers the median absolute deviation or the IQR — those measures respond to outliers more gently. But the variance's non-linearity is exactly what makes it mathematically powerful: variances of independent random variables add, which is why the sample variance is the foundation of the analysis of variance (ANOVA) and the sampling distribution of the mean.

Sample Variance Calculation Examples

Dataset: {92, 85, 78, 96, 88, 91, 84, 79, 93, 90}
n = 10, x̄ = 87.6
SS = Σ(xᵢ − x̄)² = 336.4
s² = 336.4 / 9 = 37.38
Given: SS = 900, n = 10 — solve for s²
s² = 900 / 9 = 100.00
Given: s² = 100, n = 10 — solve for SS
SS = 100 × 9 = 900.00
Given: s² = 100, SS = 900 — solve for n
n = 900 / 100 + 1 = 10
Temperature example: {18, 22, 20, 25, 15, 19, 21, 23, 20, 22} °C
n = 10, x̄ = 20.5 °C, SS = 74.5 °C²
s² = 74.5 / 9 = 8.28 °C², s = 2.88 °C
Precision example: {10.02, 9.98, 10.01, 9.99, 10.00} mm
n = 5, x̄ = 10.00 mm, SS = 1.0×10⁻³ mm²
s² = 1.0×10⁻³ / 4 = 2.5×10⁻⁴ mm², s = 0.016 mm

Frequently Asked Questions

Dividing by n − 1 corrects a systematic bias. The sample mean x̄ is computed from the same data, so the deviations xᵢ − x̄ tend to be slightly smaller than the true deviations from the unknown population mean μ. Summing their squares and dividing by n consistently underestimates σ². Dividing by n − 1 inflates the estimate by just the right amount to make it unbiased: E[s²] = σ². This correction is named after Friedrich Bessel and is known as Bessel's correction. Dividing by n gives the population variance σ², appropriate only when your data are the entire population.

The sample variance s² = SS/(n − 1) is used when your data are a subset of a larger population, and you want to estimate that population's variance. The population variance σ² = SS/n is used when your data include every member of the population. The two differ only in the denominator: n − 1 versus n. For large samples the difference is negligible — for n = 1,000, dividing by 999 instead of 1,000 changes the result by 0.1 %. But for small samples the difference matters: for n = 5, s² is 25 % larger than σ². In statistical inference the sample variance is almost always what you want, because you rarely have the entire population.

Because each deviation is squared before being summed. A point at 2 standard deviations from the mean contributes 4 to SS; a point at 10 standard deviations contributes 100 — 25 times more. This squaring amplifies the effect of extreme values disproportionately, which is a feature in some applications (variance is the natural measure of squared error) and a bug in others. If your dataset may contain outliers or heavy tails, use robust alternatives: the interquartile range (IQR = Q₃ − Q₁), the median absolute deviation (MAD), or a trimmed variance that removes the highest and lowest k percent of the data before computing SS.

Because the deviations (xᵢ − x̄) are themselves measured in the data's original units, and squaring them produces squared units. If x is in metres, then (xᵢ − x̄)² is in m². If x is in dollars, then s² is in dollars². This is why the standard deviation s = √s² is more intuitive — it restores the original units and can be compared directly to the mean. But the variance is mathematically cleaner: it is additive for independent variables, it appears naturally in the central limit theorem, and it is the parameter that characterises the normal distribution. In practice, both s² and s are reported, and the choice depends on the application.

There is no sharp threshold, but rules of thumb exist. For exploratory work, n ≥ 10 gives a rough estimate. For routine analysis, n ≥ 30 is common. For precise estimation of σ², n ≥ 100 is preferred, especially when the underlying distribution is not normal. The relative standard error of s² is approximately √(2/(n − 1)) for normal data: for n = 10 it is 47 %, for n = 30 it is 26 %, for n = 100 it is 14 %, and for n = 1,000 it is 4.5 %. So with n = 10, your sample variance could easily be off by half or double from the true population variance. With n = 100 the estimate is usually within about 15 % of the truth.

The standard error of the mean SE = s/√n measures how precisely the sample mean estimates the population mean μ. It is directly related to the sample standard deviation through the factor 1/√n. A larger sample gives a smaller standard error — the sample mean becomes a more precise estimate. For the sample variance itself, the standard error (for normal data) is SE(s²) = s²·√(2/(n − 1)). The 95 % confidence interval for the mean is approximately x̄ ± 1.96·SE for large n, or x̄ ± t_{0.025,n−1}·SE using the t-distribution for smaller samples. All of these depend on s², which is why the sample variance is such a central quantity in statistics.

Five steps. (1) Compute the mean x̄ = (Σxᵢ)/n. (2) For each value, subtract the mean to get the deviation dᵢ = xᵢ − x̄. (3) Square each deviation: dᵢ². (4) Sum the squares: SS = Σdᵢ². (5) Divide by n − 1: s² = SS/(n − 1). For example, given the dataset {4, 7, 8, 10, 11}: mean = 8; deviations = {−4, −1, 0, 2, 3}; squares = {16, 1, 0, 4, 9}; SS = 30; s² = 30/4 = 7.5. The dataset analyzer above performs all five steps automatically for arbitrary datasets — just paste your numbers and click Analyze.

Calculating...

Variables

Symbol Quantity Unit
s² Sample variance
xᵢ Each data value
x̄ Sample mean
n Sample size

What it means

Sample variance (s²) is the sum of squared deviations from the sample mean, divided by n−1 instead of n. This correction (Bessel’s correction) makes the sample variance an unbiased estimator of the population variance, because using n would underestimate the variance, especially for small samples. The sample variance is the basis for the t‑statistic, confidence intervals, and ANOVA. It is the standard measure of dispersion in sample data. Understanding the distinction between population and sample variance is crucial for correct statistical inference and for avoiding bias in estimates.

Worked example

Sample Variance – Two Examples

Real‑World
Scenario: A sample of 5 test scores: 2,4,6,8,10. Find the sample variance.
ParameterValue
Data2,4,6,8,10
x̄6
n5
1Σ(xᵢ−x̄)² = 40 (as before)
2s² = 40/(5−1) = 10
Result 10.0 ✓ Sample variance
Scenario: A researcher samples 4 values: 5,5,5,5. Calculate s².
ParameterValue
Data5,5,5,5
x̄5
n4
1All deviations zero, sum=0
2s² = 0/(4−1) = 0
Result 0 ✓ No variation
Insight: Sample variance uses (n−1) to correct for bias (Bessel's correction). It is an unbiased estimator of population variance.

Common mistakes

  • Sample variance: Uses n−1 (degrees of freedom) in the denominator – do not use n.
  • Mean x̄: The sample mean – not the population mean.
  • Units: Variance is in squared units of the data.
  • Unbiased estimator: s² is an unbiased estimator of σ².
  • N‑1 vs. N: Using N would bias the estimate downwards.

Applications

Sample variance (s²) estimates the population variance from a sample, using (n−1) in the denominator to provide an unbiased estimate. This correction is crucial in inferential statistics. Engineers use sample variance to estimate process variability from limited data, to construct confidence intervals, and to perform hypothesis tests. In research, it measures how well the sample represents the population. In quality control, it helps set control limits. By using sample variance, professionals can make reliable inferences about the population without measuring every unit. This formula is a cornerstone of statistical analysis, enabling decision‑making under uncertainty and ensuring that conclusions are based on sound principles.

  • Estimation of population variability from sample data
  • Confidence interval construction for means and variances
  • Hypothesis testing (t‑tests, F‑tests)
  • Quality control – sample‑based process monitoring
  • Research and experimental data analysis