Paste a data set and get the sample and population variance, the sum of squares each divides, the divisor in play and the standard deviation one square root away.
Separate the values with commas, spaces or line breaks. The decimal point is the dot.
Sample variance (s²)
27.4286
Sample standard deviation (s): 5.23723
Population variance (σ²)
24
Sum of squares (SS)
192
Divisor
7
Reading these numbers as a sample. The same figure in Excel: VAR.S.
These entries are not numbers and were left out:
A sample variance needs at least two values. With a single value only the population figures exist.
Type or paste at least one number to see the statistics.
Every figure from this data set
Sample standard deviation (s)
5.23723
Population standard deviation (σ)
4.89898
Sum
144
Median
18.5
Minimum
10
Maximum
23
Range
13
Standard error of the mean
1.85164
Coefficient of variation
29.1%
Step by step: building the sum of squares
Value (xᵢ)
xᵢ − x̄
(xᵢ − x̄)²
10
-8
64
12
-6
36
23
+5
25
23
+5
25
16
-2
4
23
+5
25
21
+3
9
16
-2
4
Total
0
192
The divisor is 7, so Sample variance (s²) = 192 ÷ 7 = 27.4286. Its square root, 5.23723, is the standard deviation.
Variance calculator. Sample s² and population σ², with the sum of squares and the divisor.
A variance calculator measures how far the values in a data set sit from their mean, in the square of the data's units. Paste your numbers, choose whether they are a sample or a whole population, and it returns s² or σ² together with the sum of squares that produced it and the divisor it was divided by.
What Is Variance?
Variance is the total of the squared distances between the values in a data set and their mean, divided either by how many values there are or by one less than that. The NIST/SEMATECH e-Handbook writes the sample form as s² = Σ(Yᵢ − Ȳ)²/(N − 1) and adds the consequence in a parenthesis: “the variance squares the units.” Weigh eight people in kilograms and the variance comes back in kilograms squared, which is why the square root gets taken so routinely that the variance itself is treated as a step rather than an answer.
The eight values this page loads with show the shape of the calculation before you type anything: 10, 12, 23, 23, 16, 23, 21, 16. They add to 144, so their mean is 18. Each value's gap from 18 — −8, −6, +5, +5, −2, +5, +3, −2 — squared and added up comes to 192, and that figure sits on the third card as the sum of squares. The fourth card holds the divisor. On the sample basis it reads 7, and 192 ÷ 7 = 27.4286 is the sample variance; switch the basis to population and the divisor reads 8, giving 192 ÷ 8 = 24.
The population form is the literal average of those squared gaps. The sample form is not, and the difference is deliberate: dividing by 7 rather than 8 makes the answer larger, because the mean being subtracted came from the sample itself and a sample's values sit closer to their own mean than to the unknown population mean. That adjustment is Bessel's correction, and it is why the divisor gets a card of its own on this page instead of hiding inside a formula.
Both figures appear whichever basis you pick, and the line under the cards names the spreadsheet function that matches: VAR.S for the sample basis, VAR.P for the population one. Microsoft's documentation states the rule directly — “VAR.S assumes that its arguments are a sample of the population”, and “if your data represents the entire population, then compute the variance by using VAR.P”. One relationship holds for every data set of at least two values: the sample variance is the larger of the two. They meet only when every value is identical, where the sum of squares is zero and both variances come back as zero.
Variance Formula
s2=n−1∑i=1n(xi−xˉ)2
s2 = Sample variance — the headline figure on the sample basis, in the square of your data's units
σ2 = Population variance — the same numerator divided by n instead of n − 1
SS = Sum of squares: the total of every squared gap from the mean, shown on the third card
xi = The i-th value in the data set
xˉ = The mean: the sum of the values divided by how many there are
n = How many values the data set holds
n−1 = The divisor on the sample basis, shown on the fourth card as Divisor
The population form changes the divisor and nothing else:
σ2=n∑i=1n(xi−xˉ)2
Both divide the same numerator, which carries its own name and its own card:
SS=i=1∑n(xi−xˉ)2
For the eight values above SS is 192, so the sample variance is 192 ÷ 7 = 27.4286 and the population variance is 192 ÷ 8 = 24. Take the square root of either and you have left this page for its sister: √27.4286 = 5.23723 and √24 = 4.89898 are the two standard deviations, expressed in the units of the data rather than their square.
The n − 1 is Bessel's correction, and the arithmetic reason for it fits in one sentence: the mean subtracted inside the sum was estimated from the same n values, so one degree of freedom has already been spent and only n − 1 independent deviations remain. Dividing by n would inherit the resulting bias and report a spread smaller than the population's; dividing by n − 1 cancels it. The correction is largest on tiny data sets and fades quickly: with two values the sample variance is double the population one, and with a hundred it is 1% larger.
When the Variance Is the Figure You Need
Most descriptive writing wants the standard deviation, because it lands in the units of the data and sits beside a mean without translation. The variance earns its own place whenever the next step is arithmetic rather than a sentence, and in each of the cases below substituting the square root breaks the calculation.
Variances of independent quantities add; standard deviations do not. Pishro-Nik's Introduction to Probability, Statistics, and Random Processes states it as a property: “If X₁, X₂, ⋯, Xₙ are independent random variables and X = X₁ + X₂ + ⋯ + Xₙ, then Var(X) = Var(X₁) + Var(X₂) + ⋯ + Var(Xₙ)”. Two independent parts that each behave like the eight-value data set therefore have a combined variance of 27.4286 + 27.4286 = 54.8572, whose square root is 7.40656. Adding the two standard deviations instead gives 5.23723 + 5.23723 = 10.47446, larger by a factor of √2 — a 41% overstatement that no amount of care with the individual figures would have caught.
Analysis of variance never leaves the squared units at all. Minitab's documentation defines the quantity at its center in one line: “Mean squares represent an estimate of population variance”, obtained by “dividing the corresponding sum of squares by the degrees of freedom” — the same two numbers this page puts on its third and fourth cards. A one-way ANOVA splits a total sum of squares into a between-groups part and a within-groups part, divides each by its own degrees of freedom, and compares the two quotients. No standard deviation appears anywhere in that chain.
Measurement uncertainty combines in variance space too. NIST's e-Handbook gives the first-order propagation formula for a result Y built from measurements X and Z: each input's variance is weighted by the square of a partial derivative — (∂Y/∂X)² × (variance of X) + (∂Y/∂Z)² × (variance of Z) — with a covariance term on top that vanishes when the measurements are independent, and the standard deviation of Y is the square root of that total. On a result that is simply the sum of its inputs, adding their standard deviations instead of their variances always overstates the combined uncertainty.
Rescaling behaves the same way. Var(aX + b) = a²Var(X), so converting a column from meters to centimeters multiplies its variance by 10,000 while the shape of the data does not move at all. That square is also what makes variance components work: a total variance can be split into named contributions — between operators, between parts, repeated measurement — and reported as percentages of the whole, because those parts add. The same percentages taken from standard deviations would not sum back to the total.
How to Calculate Variance by Hand
Five steps produce the figure, and the table under the results lays out steps 2 to 4 in the exact columns a marked worksheet asks for. Worked here on the eight values the page loads with.
2. Subtract the mean from each value, giving −8, −6, +5, +5, −2, +5, +3, −2. Add that column before going on: −8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0. Deviations from a correct mean always cancel, so a non-zero total means the mean is wrong.
4. Add the squares: 192. That total is the sum of squares, and it is the Total row of the step-by-step table.
5. Divide by the divisor. For a sample, 192 ÷ 7 = 27.4286. For a population, 192 ÷ 8 = 24. The quotient is the variance, and the procedure ends here — taking a square root at this point converts the answer into the standard deviation, which is a different figure on a different page.
The table under the results carries the columns Value (xᵢ), xᵢ − x̄ and (xᵢ − x̄)², with 192 in the Total row, and its caption spells the last division out: the divisor is 7, so the sample variance is 192 ÷ 7 = 27.4286, and its square root, 5.23723, is the standard deviation. On long data sets the table prints the first 30 rows and names the full count they are drawn from; the Total row still covers all of them, so the sum of squares is never partial.
The Four Cards, and Getting a Column In
The headline card holds the variance for the basis you picked, labeled Sample variance (s²) or Population variance (σ²), with the matching standard deviation on the line beneath it. The card next to it holds the same data read on the other basis, so both answers are visible without touching a control. The third card is the sum of squares and the fourth is the divisor, which is the pair a worksheet usually wants quoted together.
The mean and the value count have no card here — that pair heads the sister page. The mean is still recoverable from the middle column of the step table, as the gap between each value and it, and the value count can be read off the divisor: on the population basis the divisor is n, and on the sample basis it is n − 1, so add one.
The data field takes a whole column at once, up to 5,000 characters, which is a spreadsheet column of several hundred numbers. Line breaks count as separators, so pasting straight out of Excel, Sheets, Numbers or a CSV works without reformatting. A basis control and a decimal-mark control sit underneath it. The basis decides which figure is the headline and which spreadsheet function gets named; the decimal mark, labeled 1.5 and 1,5, decides what a comma means:
1. With the decimal mark on 1.5, the separators are spaces, line breaks, tabs, semicolons and commas. Thousands grouping is not recognized in this mode, so 1,234.5 is read as two values, 1 and 234.5.
2. With the decimal mark on 1,5, the comma is a decimal point and no longer splits anything. Spaces, line breaks, tabs and semicolons separate, and a period is treated as a thousands group, so 1.234,5 is the single value 1234.5. Pasting 1,5 2,7 3,1 gives three values in this mode and six in the other one.
Negative values and scientific notation both survive: a leading minus sign is kept and 1.5e3 is read as 1500. Anything that is not a number is set aside rather than swallowed, and the first five entries that were dropped are listed by name under the results, so a stray header row or an “n/a” cell shows up as a line of text on screen instead of changing the mean in silence.
What the n − 1 Divisor Is Worth at Each Sample Size
Values (n)
Sample divisor (n − 1)
Sample variance ÷ population variance
Sample deviation ÷ population deviation
2
1
2.000 (+100%)
1.414 (+41.4%)
5
4
1.250 (+25%)
1.118 (+11.8%)
8
7
1.143 (+14.3%)
1.069 (+6.9%)
10
9
1.111 (+11.1%)
1.054 (+5.4%)
30
29
1.034 (+3.4%)
1.017 (+1.7%)
100
99
1.010 (+1.0%)
1.005 (+0.5%)
1,000
999
1.001 (+0.1%)
1.0005 (+0.05%)
Worked Examples
The Eight Values the Page Loads With
The data set 10, 12, 23, 23, 16, 23, 21, 16 on the sample basis returns a sample variance of 27.4286, with the sample standard deviation 5.23723 on the line under it and the population variance 24 on the card beside it. The sum of squares is 192 and the divisor is 7. The figures block adds the rest: sample standard deviation 5.23723, population standard deviation 4.89898, sum 144, median 18.5, minimum 10, maximum 23, range 13, standard error of the mean 1.85164 and coefficient of variation 29.1%. Under the cards one line states the basis in words and names the function: reading these numbers as a sample, the same figure in Excel is VAR.S. Switching the basis to Population (n) moves 24 to the headline, leaves the sum of squares at 192, changes the divisor card from 7 to 8, and renames the function to VAR.P.
Five Lab Readings, Both Bases from One Paste
Paste 2.5, 3.1, 4.8, 5.2, 6.0 and the sample variance is 2.157, with the sample standard deviation 1.46867 beneath it and the population variance 1.7256 on the card next to it. The sum of squares is 8.628 and the divisor is 4, so the arithmetic on screen is 8.628 ÷ 4 = 2.157; on the population basis the divisor becomes 5 and the same 8.628 gives 1.7256. The remaining figures: population standard deviation 1.31362, sum 21.6, median 4.8, minimum 2.5, maximum 6, range 3.5, standard error of the mean 0.65681 and coefficient of variation 34%. Comparing the two data sets by variance alone is meaningless here — 2.157 against 27.4286 says only that lab readings around 4.32 are smaller numbers than scores around 18. The coefficient of variation is the comparable figure: 34% against 29.1% makes the five readings the more scattered set relative to their own mean.
Two Independent Parts: Why the Variances Add and the Deviations Do Not
Suppose a finished assembly is the sum of two independent parts, and each part's measurements behave like the eight-value data set — sample variance 27.4286, sample standard deviation 5.23723. The variance of the total is 27.4286 + 27.4286 = 54.8572, and the standard deviation of the total is its square root, 7.40656. Adding the two standard deviations gives 10.47446, which is 41% too large, because it assumes the two parts always drift in the same direction on the same unit. This is the whole reason to keep the variance rather than reporting only its root: the addition is legal in squared units and illegal outside them. Run each part through this calculator, add the two headline figures, then take one square root at the very end.
A Single Value, Where the Divisor Reaches Zero
Paste 42 on its own with the sample basis selected and the headline card shows a dash, the divisor card shows 0, and a line appears under the cards: a sample variance needs at least two values, and with a single value only the population figures exist. The card beside the headline reports the population variance as 0, the sum of squares is 0, and the figures block gives population standard deviation 0, sum 42, median 42, minimum 42, maximum 42 and range 0, with dashes for the sample standard deviation, the standard error and the coefficient of variation. The distinction matters: 0 means measured and found to have no spread, while the dash means the quantity does not exist, since n − 1 is zero and nothing can be divided by it.
Mistakes That Change the Answer
Reporting the variance in the data's own units — a variance of 27.4286 computed from kilograms is 27.4286 kg², not 27.4 kg. The two figures differ by a factor of the standard deviation itself, so the mislabeled number is 5.23723 times too big on this data set, and on a set whose spread is below 1 it would be too small instead. A sentence that needs a unit the reader can picture needs the square root, not this figure.
Averaging the raw deviations instead of the squared ones — the gaps from the mean cancel by construction: −8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0. Squaring is what stops the cancellation, and it is also what puts the answer in squared units.
Adding standard deviations when it is the variances that add — for two independent quantities, 5.23723 + 5.23723 = 10.47446 is wrong and √(27.4286 + 27.4286) = 7.40656 is right. The shortcut overstates the combined spread every time, by more the closer the two spreads are to each other.
Choosing the basis by habit rather than by what the data is — the population form is exact only when the numbers in the box are the entire group. On a subset it understates: 24 against 27.4286 on the same eight values. Microsoft's own rule for the matching spreadsheet function is the test to apply — if the data represents the entire population, use VAR.P, and otherwise VAR.S.
Reading the Divisor card as the number of values — on the sample basis it is n − 1, so a divisor of 7 means eight values were parsed, not seven. Add one, or switch to the population basis where the divisor is n exactly. This is the fastest check that a paste split the way you intended.
Pasting thousands-grouped numbers with the decimal mark on 1.5 — 1,234.5 becomes two values, 1 and 234.5, which inflates the divisor and collapses the mean. Switch the decimal mark and let the period do the grouping, or strip the separators before pasting.
Comparing variances across different scales or units — variance scales with the square of the unit, so the same measurements in centimeters carry a variance 10,000 times the one in meters. Comparing two data sets means comparing coefficients of variation, 29.1% against 34% on the two examples above, or converting both to a common unit first.
Getting a Variance You Can Defend
Read the Divisor card before the headline — it is where this page shows how many values were parsed. Divisor plus one on the sample basis, or the divisor itself on the population basis. If that number is not what you pasted, the decimal mark is splitting something you meant as a decimal.
Add the middle column of the step table — the deviations have to total zero (−8 − 6 + 5 + 5 − 2 + 5 + 3 − 2 = 0 on the default data). It is the one self-check in the whole procedure, and it catches a wrong mean before the error reaches the squares.
Quote the sum of squares and the divisor together — 192 and 7 let anyone reproduce either variance, and either standard deviation, without your data set. That pair is also what a marked worksheet and an ANOVA table both ask for.
Keep the variance when the next step is arithmetic, and switch pages when the next step is a sentence — adding, weighting, decomposing and propagating all happen in squared units, while anything a reader has to picture belongs in the original units. The footer link goes straight to the standard deviation calculator for that second case.
Use the coefficient of variation to compare data sets — it is the sample standard deviation as a percentage of the mean, 29.1% for the eight-value example. Two variances measured in different units cannot be compared at all; two coefficients of variation can. There is no universal cut-off for a high one, so the threshold has to come from your own field.
Match the basis to the spreadsheet before you argue about a discrepancy — if a colleague's sheet says 24 and this page says 27.4286, the disagreement is the divisor and not an error. The line under the cards names VAR.S or VAR.P so that conversation ends in one glance.
Round once, at the end — the cards carry six significant figures rather than two decimals so that the rounding can wait. Rounding the deviations before squaring them compounds the error twice, once in the square and once in the division.
Key Terms
Variance (s², σ²)
The sum of squares divided by the divisor, expressed in the square of the data's units. It is 27.4286 on the sample basis and 24 on the population basis for the data set this page loads with.
Sum of squares (SS)
The total of every squared gap between a value and the mean, written Σ(xᵢ − x̄)². It is 192 for the default data set, it sits on the third card, and it is the quantity both variances divide.
Divisor (degrees of freedom)
What the sum of squares is divided by: n − 1 on the sample basis, n on the population basis. With eight values that is 7 or 8, and it is the only number that differs between the two answers.
Bessel's correction
Using n − 1 rather than n for a sample. It compensates for the fact that a sample's values sit closer to their own mean than to the unknown population mean, which would otherwise make the estimated spread too small.
Unbiased estimator
An estimate that is right on average across repeated samples, neither systematically high nor systematically low. The sample variance with the n − 1 divisor is one; the same sum of squares divided by n is not.
Mean square
The name a variance takes inside an ANOVA table: a sum of squares divided by its degrees of freedom. Minitab's documentation describes mean squares as an estimate of population variance, which is the same operation the third and fourth cards of this page show.
Variance addition
The property that the variance of a sum of independent quantities equals the sum of their variances. Standard deviations have no such rule, which is why a total is built from variances and rooted only at the end.
Coefficient of variation
The sample standard deviation as a percentage of the mean, 29.1% for the default data set. It is the figure that lets data sets in different units be compared, and it is undefined when the mean is zero.
What This Calculator Does Not Do
The page is descriptive. It reports what your numbers do and claims nothing about the process that produced them: no significance test, no confidence interval, no normality check, no distribution fitting and no chart. Rules of thumb that turn a spread into a share of the data assume a bell-shaped distribution, and nothing here tests whether yours is one.
The page has no mode and no quartiles, and it has no card for the mean or for the value count: those two head the sister page, and the third and fourth cards here belong to the sum of squares and the divisor instead. What is printed alongside the two variances is the sample and population standard deviation, the sum, the median, the minimum, the maximum, the range, the standard error of the mean and the coefficient of variation.
The field accepts 5,000 characters. The step-by-step table lists the first 30 values and states in its caption the total it is drawn from, while the Total row still covers every value, so the sum of squares is complete even when the table is not.
“Does not exist” is treated as a different answer from zero. A single value read as a sample shows a dash for the sample variance and a divisor of 0, with a line explaining that a sample variance needs at least two values, while the population variance shows 0 — correct, because one value has no spread. A data set whose mean is exactly zero shows a dash for the coefficient of variation and prints the reason underneath, since dividing by a zero mean has no meaning.
Frequently Asked Questions About Variance
Should I use the sample variance or the population variance?
Use the sample basis when your numbers are part of a larger group you want to describe, and the population basis when they are the whole group. If someone could have measured more of the same thing, what you have is a sample — the basis this page opens on.
Why is variance divided by n − 1 instead of n?
Because the mean you subtract came from the sample itself, and a sample's values sit closer to their own mean than to the population's. Dividing by n would leave the estimate biased low, and dividing by n − 1 removes that bias. The adjustment is Bessel's correction.
What are the units of variance?
The square of the data's units. Weights in kilograms give a variance in kilograms squared, and prices in dollars give a variance in dollars squared. Taking the square root returns the figure to the original units, and that root is the standard deviation.
Which Excel function matches this calculator?
VAR.S on the sample basis and VAR.P on the population basis, and the line under the cards names whichever one is in play. Google Sheets carries both names with the same meanings, describing VAR.S as the variance based on a sample and VAR.P as the variance based on an entire population, and keeps the older VAR and VARP alongside them.
Is variance the same as standard deviation?
No. The variance is the sum of squares divided by the divisor, and the standard deviation is the square root of that variance — 27.4286 and 5.23723 on the eight values this page loads with. They carry the same information in different units, and the squared units are what make the variance usable in further arithmetic.
Can variance be negative?
No. It is a total of squared numbers divided by a positive divisor, so it is either positive or zero. Zero happens only when every value in the set is identical, in which case the sum of squares is zero and both variances are zero.
Is this the same as budget variance or a percentage variance?
No. Budget variance is one number minus another — actual against forecast — and is usually reported as that difference or as a percentage of the plan. This page calculates the statistical variance, which needs a whole data set and measures how far its values scatter around their own mean.
Do variances add?
For independent quantities, yes: the variance of a sum is the sum of the variances. Two independent parts with a variance of 27.4286 each give 54.8572 for the total, whose square root is 7.40656. Standard deviations do not add — 5.23723 + 5.23723 = 10.47446 overstates the combined spread by 41%.
What do I do with the sum of squares?
It is the number a marked worksheet usually asks to see, and quoting it with the divisor lets anyone reproduce either variance from two figures. It also carries forward: an ANOVA table divides sums of squares by their degrees of freedom to produce mean squares, which Minitab's documentation describes as estimates of population variance — the same operation the third and fourth cards show.
Why does my spreadsheet give a different variance than this calculator?
Almost every mismatch comes down to the basis, or to what the sheet skipped without saying so. VAR.P divides by n and VAR.S by n − 1, which on the eight-value example is the gap between 24 and 27.4286. Microsoft also documents that VAR.S ignores empty cells, logical values, text and error values inside a referenced range, and the sheet shows nothing on screen to say it did; this page lists the entries it could not read, by name, under the results.
What is the variance of a single number?
On the population basis it is 0, because one value has no spread. On the sample basis it does not exist, since the divisor n − 1 is zero. The calculator shows 0 for the first and a dash for the second, with the divisor card reading 0 and a line explaining why.
My numbers use commas as decimal points. Will the calculator read them?
Yes — set the decimal mark control to 1,5 and the comma becomes a decimal point instead of a separator. Semicolons, spaces, tabs and line breaks then do the splitting, and a period is read as a thousands group, so a column of 1.234,5 comes through as the single value 1234.5. Check the Divisor card afterwards: on the sample basis it should be one below the count you pasted, and if it is higher the mark is still on 1.5 and every comma has split a value in two.
How accurate is this variance calculator?
It makes two passes over the data — the mean first, then the squared gaps from it — instead of the one-line shortcut Σx² − (Σx)²/n. NIST publishes reference data sets with certified values to expose the difference. On NumAcc1 both approaches return the certified figure exactly. On NumAcc2 the shortcut lands about four orders of magnitude further from the certified value. On NumAcc4, the only one of NIST's nine univariate sets graded higher difficulty, the shortcut's subtraction goes negative, so it reports a variance below zero and no standard deviation at all, while the two-pass result matches the certified sample standard deviation of 0.1 — a variance of 0.01 — to eight significant figures.
How many values can I paste at once?
The field takes 5,000 characters, which is a few hundred numbers from a spreadsheet column, and every value counts toward the statistics. The step-by-step table shows the first 30 rows and says how many it left out; its Total row is the sum of squares over the whole data set, not over the rows on display.
Is this variance calculator free to use?
Yes. It runs in any browser on a phone, tablet or computer, with nothing to install and no limit on how many data sets you work through. The figures recompute as you type or paste, so changing the basis or the decimal mark updates all four cards, the figures block and the step-by-step table at once.