Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeVariance is the average squared distance from the mean, so it is in squared units; standard deviation is its square root, back in the data's own unit. They describe the same spread. Report the standard deviation, because people can read it; calculate with the variance, because variances add. Below, both are computed by hand on seven session durations.
What you will learn
- Same spread, different units: variance is in squared units, standard deviation in the data's unit
- Report the SD; put the variance into formulas, because variances of independent parts add and SDs do not
- Divide by n − 1 for samples; one extreme value can dominate both, so filter bots and check skew first
What is the difference between variance and standard deviation?
Variance and standard deviation measure the same thing, how far values spread around their mean, in different units:
- Variance is the average squared distance from the mean. Because the distances are squared, its unit is squared too: seconds², dollars².
- Standard deviation (SD) is the square root of the variance. Taking the root puts it back in the data's own unit: seconds, dollars.
The NIST/SEMATECH e-Handbook puts the relationship in one line: the standard deviation "restores the units of the spread to the original data units (the variance squares the units)."
| Variance | Standard deviation | |
|---|---|---|
| Formula (sample) | s² = Σ(x − x̄)² ÷ (n − 1) | s = √s² |
| Unit | Squared unit of the data | Same unit as the data |
| Read directly? | Hard: "3,675 seconds²" has no intuitive meaning | Easy: "about 61 seconds either side of the mean" |
| Adds up across independent parts? | Yes | No |
| Typical use | Formulas: sums of variables, sample size, variance reduction | Reporting, z-scores, error bars |
So the practical rule this article works through: report the standard deviation, calculate with the variance. The rest shows both computed by hand on one small dataset, then where each belongs.
Worked example: seven session durations by hand
Sample data: seven sessions on a pricing page lasted 30, 45, 60, 75, 90, 120 and 210 seconds.
Step 1: mean. (30 + 45 + 60 + 75 + 90 + 120 + 210) ÷ 7 = 630 ÷ 7 = 90 seconds.
Step 2: deviations and squared deviations.
| Session | Duration (s) | Deviation from mean (s) | Squared deviation (s²) |
|---|---|---|---|
| 1 | 30 | −60 | 3,600 |
| 2 | 45 | −45 | 2,025 |
| 3 | 60 | −30 | 900 |
| 4 | 75 | −15 | 225 |
| 5 | 90 | 0 | 0 |
| 6 | 120 | +30 | 900 |
| 7 | 210 | +120 | 14,400 |
| Sum | 630 | 0 | 22,050 |
The deviations always sum to zero, which is why spread can't be measured by averaging them: positive and negative cancel. Squaring removes the signs.
Step 3: variance.
- Population variance (divide by n = 7): 22,050 ÷ 7 = 3,150 s².
- Sample variance (divide by n − 1 = 6): 22,050 ÷ 6 = 3,675 s².
Step 4: standard deviation.
- Population SD: √3,150 = 56.1 seconds.
- Sample SD: √3,675 = 60.6 seconds.
Read the sample SD as "a typical session on this page lasts about 90 seconds, give or take about 61". The variance, 3,675 s², carries exactly the same information but can't be read that way.
Population or sample: should you divide by n or n − 1?
Divide by n when the data is the entire population you care about, for example every session in March when March is the only thing you are describing. Divide by n − 1 when the data is a sample used to estimate the spread of a larger population, for example seven sessions standing in for all visitors to the page. Almost every analytics question is the second kind.
The reason for n − 1 (Bessel's correction): deviations are measured from the sample mean, which is pulled toward the sample's own values, so they come out slightly smaller than deviations from the true mean would. Dividing by one less corrects that downward bias in the variance. The correction matters for small samples, such as 3,675 vs 3,150 here, a 17% difference. With 7,000 sessions the gap would be about 0.01% and irrelevant.
Spreadsheet and code defaults differ, so check which one you're using:
| Tool or function | Divides by |
|---|---|
VAR.S, STDEV.S (spreadsheets) | n − 1 |
VAR.P, STDEV.P (spreadsheets) | n |
Python statistics.variance, statistics.stdev | n − 1 |
Python statistics.pvariance, statistics.pstdev | n |
NumPy var, std (default ddof=0) | n |
pandas Series.var, Series.std (default ddof=1) | n − 1 |
Why does one long session dominate the variance?
Squaring makes large deviations count far more than small ones. In the example, the 210-second session is 120 seconds from the mean, and 120² = 14,400 is 65% of the total sum of squares, 22,050. The other six sessions together contribute the remaining 35%.
Two consequences:
- Variance and SD are sensitive to outliers. One bot session lasting 30 minutes, or one visitor who left a tab open, can double the SD of a small sample. Filter bots and cap or trim known artefacts before computing spread.
- Skewed data makes "mean ± SD" misleading. Session durations are usually right-skewed: many short sessions, a long tail. Here mean − SD = 29 seconds and mean + SD = 151 seconds, which suggests a symmetry that isn't there: five of seven sessions are at or below the mean, and one session sits two SDs above it. For skewed metrics, report the median and percentiles alongside (see mean vs median).
Share of the sum of squared deviations by session
% of 22,050 s²When should you report the standard deviation?
Use the SD whenever a person has to read the number:
- Describing spread in a report. "Average order value $52, SD $18" is understandable; "variance 324 dollars²" is not. It is one of the basic descriptive statistics alongside the mean and median.
- Z-scores. z = (value − mean) ÷ SD. The 210-second session has z = (210 − 90) ÷ 60.6 = 1.98, roughly two standard deviations above the mean; the 30-second session has z = −0.99.
- Error bars and control charts. Bands drawn at mean ± 1, 2 or 3 SD sit on the same axis as the data.
- Comparing variability in the same unit. Delivery time SD of 0.8 days for one carrier and 2.1 days for another is a direct, readable comparison.
When should you use the variance instead?
Use the variance when the number goes into a formula, because variance behaves additively and standard deviation does not.
1. Adding independent quantities. For independent variables, Var(X + Y) = Var(X) + Var(Y). If time on page A has SD 40 s and time on page B has SD 30 s, independent of each other, the total time has variance 1,600 + 900 = 2,500 s² and SD √2,500 = 50 s, not 40 + 30 = 70 s. Adding standard deviations overstates the spread.
2. Sample size and power. For comparing two means, the sample size per group is n = 2 × (z₁₋α/₂ + z₁₋β)² × σ² ÷ δ², where σ² is the variance and δ the difference you want to detect. With the example's variance, 3,675 s², α = 0.05 and 80% power, detecting a 10-second difference needs 2 × (1.96 + 0.84)² × 3,675 ÷ 10² ≈ 577 sessions per group. Because n scales with the variance, halving the SD to 30.3 s cuts the requirement to about 145 per group, a quarter, not a half.
3. Variance reduction (CUPED). The CUPED method of Deng, Xu, Kohavi and Walker (2013) adjusts a test metric with the same metric from before the test. With correlation ρ between the two, the adjusted metric's variance is multiplied by 1 − ρ². At ρ = 0.5 the variance falls to 75% of the original, so the same test needs about 577 × 0.75 ≈ 433 sessions per group; the SD only falls to √0.75 = 86.6%, which understates the gain if you think in SDs.
4. Pooling groups and analysis of variance. Pooled variance, ANOVA and regression all decompose total variance into parts. Those sums only work in squared units.
The decision table on this page summarises which to use.
| Task | Use | Why |
|---|---|---|
| Describe spread in a report | Standard deviation | Same unit as the data |
| Compute a z-score or error bar | Standard deviation | Distance measured in the data's unit |
| Add independent quantities | Variance | Var(X + Y) = Var(X) + Var(Y); SDs don't add |
| Calculate sample size or power | Variance | n grows in proportion to σ² |
| Variance reduction such as CUPED | Variance | Reduction factor is 1 − ρ² on the variance |
| Compare spread across different means | Coefficient of variation | SD ÷ mean removes the scale |
Use the sample versions (divide by n − 1) when the data estimates a larger population.
How is variance different from standard error?
A third quantity is often confused with both. The standard error of the mean is the SD divided by √n: it measures how precisely the mean is estimated, not how spread out individual values are. For the seven sessions, SE = 60.6 ÷ √7 = 22.9 seconds. Add more sessions and the SE shrinks; the SD settles around the true spread of the page and doesn't shrink. If you're deciding whether two averages differ, you need the SE; the full comparison is in standard deviation vs standard error.
What mistakes do people make with variance and standard deviation?
- Adding standard deviations. Add variances of independent parts, then take the root.
- Mixing n and n − 1 between tools. A dashboard in NumPy and a spreadsheet using
STDEV.Swill disagree on small samples. Pick one and say which. - Reporting variance to non-statisticians. Squared units mislead; convert to SD.
- Reporting mean ± SD for skewed data. Durations, order values and revenue per user are skewed; add median and percentiles.
- Leaving bots and stuck tabs in. A few extreme values can dominate the sum of squares, as the 210-second session did with 65%.
- Comparing SDs of metrics with very different means. An SD of $18 on a $52 average is large; on a $500 average it is small. Use the coefficient of variation (SD ÷ mean) for that comparison.
Computing spread on your own data in TapCub
Here is how you would get the inputs for the session example from your own site in TapCub. It shows the distribution and the summary statistics; the variance itself you compute in SQL or a sheet.
- Look at the shape first. In All-platform analytics › Behavior › Behavior analysis, the distribution view can use session duration as its subject. It shows a histogram with each bucket's count and share, plus the mean and the median. A long right tail tells you to report the median alongside any SD.
- Save the summary metrics you'll reuse. All-platform analytics › Behavior › Metrics & SQL lets you define a metric from an event plus an aggregation such as property average, median, 90th percentile, min or max, for example on an order-value property. It has no variance or SD aggregation.
- Compute variance and SD in the SQL playground. The SQL tab in All-platform analytics › Behavior › Behavior analysis accepts one
SELECTover the project's views. A query onv_sessionssuch asSELECT device_type, COUNT(*) AS n, AVG(duration) AS mean_duration, (SUM(duration * duration) - COUNT(*) * AVG(duration) * AVG(duration)) / (COUNT(*) - 1) AS sample_variance FROM v_sessions GROUP BY device_typereturns the sample variance per device type; take its square root for the SD. Results can be exported as CSV. - Keep bots out. Recognised bots are reported separately in Web analytics › Bots by default, so crawler sessions don't sit in the long tail of your duration data.
FAQ
What is the main difference between variance and standard deviation?
The unit. Variance is the average squared distance from the mean, so it is in squared units (seconds², dollars²). Standard deviation is its square root, back in the data's own unit. They carry the same information about spread; SD is easier to read, while variance is easier to calculate with.
Why is standard deviation used more than variance?
Because it is in the same unit as the data, so it can be read directly ("about 61 seconds either side of 90") and drawn on the same axis as the values. Variance is used more inside formulas, such as sample size, combining independent variables and variance reduction, where its additivity matters.
Is variance always larger than standard deviation?
No. Variance is larger than SD when the SD is above 1, and smaller when the SD is below 1, because squaring a number below 1 makes it smaller. For conversion rates expressed as proportions, an SD of 0.2 gives a variance of 0.04. The two are only equal at 0 and 1.
When do you use n − 1 instead of n?
Use n − 1 when your data is a sample used to estimate the spread of a larger population, which is almost every analytics question. Use n only when the data is the entire population you are describing. The difference is large for small samples (17% with seven values) and negligible for thousands.
Can variance be negative?
No. It is an average of squared numbers, so the smallest possible value is 0, which happens only when every value is identical. A negative result in a spreadsheet or SQL usually comes from floating-point rounding in a shortcut formula on near-identical values; compute it from deviations instead.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods. 1.3.5.6 Measures of Scale — variance and standard deviation formulas with n − 1. Checked 2026-11-28.
- Alex Deng, Ya Xu, Ron Kohavi & Toby Walker. Improving the Sensitivity of Online Controlled Experiments by Utilizing Pre-Experiment Data. WSDM 2013 — CUPED and the 1 − ρ² variance factor. Checked 2026-11-28.
- NIST/SEMATECH e-Handbook of Statistical Methods. 7.2.2.2 Sample sizes required — sample size grows with the variance. Checked 2026-11-28.
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Analyst
Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.



