Free Standard Deviation Tool

Standard Deviation Calculator

A standard deviation calculator measures how spread out numbers are from the mean. Enter your data values and instantly get population standard deviation (σ), sample standard deviation (s), variance, mean, range, and coefficient of variation — with full step-by-step breakdowns showing every calculation.

Data Input

Separate values with commas, spaces, tabs, or new lines
0 values entered

Enter data values to see results

Population vs. Sample

Population Variance and Sample Variance Calculator

A variance calculator computes the spread of data points from the mean. It handles both whole population and sampled data — pick the type, enter numbers, get the variance value.

Population variance and sample variance differ in one place: the divisor. Population variance divides the sum of squared differences by n (total count). Sample variance divides by n − 1 — Bessel's correction — to produce an unbiased variance estimate from sampled data. This correction matters most with small samples. For large datasets, the difference shrinks.

Whole Population (N) Sample (n)
20 of 20 data points used
Population
σ² = Σ(xᵢ − μ)² / n
Divides by n because you have every data point in the whole population. The mean (μ) is exact — no correction needed.
σ² Population Variance
  • Uses every data point in the whole population
  • Divides sum of squares by n
  • Mean symbol: μ (mu) — the true population mean
  • Used in census data, full datasets, quality control
Sample Variance
  • Uses a subset of sampled data from the population
  • Divides sum of squares by n − 1 (degrees of freedom)
  • Mean symbol: (x-bar) — estimated mean
  • Used in surveys, experimental design, clinical trials

When to use each variance formula

📊 Financial forecasting — Use sample variance when analyzing stock returns from a time window (sampled data from an ongoing process).
🏭 Quality control — Use population variance when you measure every product in a batch during process optimization.
🧪 Clinical trials — Use sample variance because you test a subset of patients, not the whole population.
📐 Educational assessments — Use population variance when every student in a class takes the same test.
Method

How to Calculate Variance

Variance measures how far each number in a data set sits from the mean. These are the variance calculation steps.

To calculate variance, find the average of the squared differences from the mean. The process is the same for population variance and sample variance — the only difference is whether you divide by n or n − 1 at the end. This statistical variance calculation works for any data set, from survey analysis to machine learning feature selection.

Try it: Enter numbers and watch each step

Type 3–8 numbers separated by commas. The steps below will calculate variance with your data in real time.

1

Find the Mean (Average)

Add all values in the data set and divide by the count. For [4, 8, 6, 5, 3], the mean is (4+8+6+5+3) ÷ 5 = 5.2. This mean is the center point for every variance calculation.

x̄ = Σxᵢ / n
0 3 4 5 6 8 x̄ = 5.2
2

Find Each Deviation from the Mean

Subtract the mean from each value. For 4: (4 − 5.2) = −1.2. For 8: (8 − 5.2) = 2.8. Repeat for every data point. These mean deviations show how far each number sits from center.

dᵢ = xᵢ − x̄
3

Square Each Deviation

Squaring removes negative signs and weights larger deviations more heavily. (−1.2)² = 1.44. (2.8)² = 7.84. This step is why variance uses squared differences — it prevents positive and negative deviations from canceling out.

(xᵢ − x̄)²
4

Sum the Squared Deviations

Add all squared deviations. This gives the total squared distance from the mean: 1.44 + 7.84 + 0.64 + 0.04 + 4.84 = 14.8. This sum of squares is the numerator in every variance equation.

Σ(xᵢ − x̄)²
5

Divide by Count

For population variance, divide by n (here: 14.8 ÷ 5 = 2.96). For sample variance, divide by n − 1 (here: 14.8 ÷ 4 = 3.7). The n − 1 divisor accounts for degrees of freedom in sampled data.

σ² = 14.8 / 5 = 2.96 s² = 14.8 / 4 = 3.70
Reference

Variance Formula

The variance formula calculates the average of squared differences from the mean. Click any symbol below to see what it represents.

Two variance formulas exist because two situations exist. When you have the complete data set (every member of the group), use the population variance formula. When you only have sampled data (a portion of a larger group), use the sample variance formula with Bessel's correction. Both formulas share the same structure — the only change is the divisor.

Formula Anatomy — Click any symbol

= ( ) / ( )
Click any symbol in the formula above to see its role in the variance equation.
Sample Sample Variance Formula
= Σ ( xᵢ ) ² / ( n 1 )

Uses n − 1 (Bessel's correction) for an unbiased variance estimate from sampled data. This adjustment accounts for degrees of freedom when the true population mean is unknown.

Population Population Variance Formula
σ² = Σ ( xᵢ μ ) ² / n

Divides by n directly. No correction needed because the population mean (μ) is the true mean of the whole population.

How Data Flows Through the Formula

📊 Raw Data xᵢ values
📐 Mean x̄ or μ
↔️ Deviations xᵢ − mean
Squared (xᵢ − mean)²
Variance σ² or s²
The only difference: population variance divides by n, sample variance divides by n − 1. Everything else in the variance equation is identical. The n − 1 correction matters most with small sample sizes — for very large samples, the difference between population variance and sample variance becomes negligible. Software like Excel, R, Python, SPSS, and Google Sheets all use these same formulas.
Worked Example

Example Calculation

Walk through a complete variance calculation step by step with real numbers and an interactive bar chart.

Consider the data set: 4, 8, 6, 5, 3, 7, 2, 9. We'll calculate both sample variance (s²) and population variance (σ²) for these 8 values. Watch the bar chart below — it shows each data point, the mean line, and the squared deviations as you scroll through each step.

0 3 6 9 4 8 6 5 3 7 2 9 x̄ = 5.5
Data Set
4 8 6 5 3 7 2 9
Step 1 Calculate the Mean
x̄ = (4 + 8 + 6 + 5 + 3 + 7 + 2 + 9) / 8
x̄ = 44 / 8 = 5.5

The mean is the center of the data set — every deviation is measured from this point. In the bar chart above, the dashed line marks x̄ = 5.5.

Step 2 Find Deviations and Square Them
xᵢ xᵢ − x̄ (xᵢ − x̄)²
4−1.52.25
82.56.25
60.50.25
5−0.50.25
3−2.56.25
71.52.25
2−3.512.25
93.512.25

Each row shows one data point, its deviation from the mean, and the squared deviation. Notice how values far from x̄ (like 2 and 9) produce much larger squared differences.

Step 3 Sum the Squared Deviations
Σ(xᵢ − x̄)² = 2.25 + 6.25 + 0.25 + 0.25 + 6.25 + 2.25 + 12.25 + 12.25
Σ(xᵢ − x̄)² = 42

This sum of squares (42) represents the total squared distance of all data points from the mean. It's the numerator in both variance formulas.

Step 4 Divide to Get Variance
Population Variance (σ²)
42 / 8 = 5.25
Divided by n = 8 (whole population)
Sample Variance (s²)
42 / 7 = 6
Divided by n − 1 = 7 (Bessel's correction)
Standard deviation is the square root of variance. For this data set: population σ = √5.25 ≈ 2.291, sample s = √6 ≈ 2.449. Standard deviation uses the same units as the original data, which makes it easier to interpret than variance. You can calculate variance and standard deviation together in Excel using VAR.S (sample) and VAR.P (population) functions, or in Google Sheets, R, Python, and SPSS.
Manual Method

How to Calculate Variance by Hand

A step-by-step checklist to calculate variance manually — no software needed.

You don't need a variance calculator tool or statistical software to find variance. Pen, paper, and arithmetic work fine. This checklist applies to any data set — follow it from top to bottom and you'll have your variance value. The same variance calculation steps work whether you compute population variance or sample variance.

Scratch Pad
Data: 1
n = 5
Sum = 3+7+5+9+1 = 25
Mean = 25 ÷ 5 = 5
Deviations: −2, 2, 0, 4, −4
Squared: 4, 4, 0, 16, 16
Sum of squares = 40
σ² = 40/5 = 8   s² = 40/4 = 10
Step 1 Write down all values and count them

List every number in the data set. Count the total (n). This count determines whether you divide by n (population) or n − 1 (sample) when computing variance.

Example: Data set = 1 → n = 5
Step 2 Add all values and compute the mean

Sum = 3 + 7 + 5 + 9 + 1 = 25. Mean = 25 ÷ 5 = 5. Write this number down — you'll use it in every remaining step of the variance calculation.

Step 3 Subtract the mean from each value

Create a column of deviations. Some are negative, some positive. A quick accuracy check: add them all up — the result should be 0 (or close to it). This works because deviations from the mean always cancel out.

3−5 = −2, 7−5 = 2, 5−5 = 0, 9−5 = 4, 1−5 = −4
Step 4 Square each deviation and add them up

Multiply each deviation by itself. Then sum them: (−2)² + 2² + 0² + 4² + (−4)² = 4 + 4 + 0 + 16 + 16 = 40. This sum of squares is the basis for both the population and sample variance formulas.

Step 5 Divide by n (population) or n − 1 (sample)

Population variance: 40 ÷ 5 = 8. Sample variance: 40 ÷ 4 = 10. That's your variance value. For standard deviation, take the square root: σ = √8 ≈ 2.83, s = √10 ≈ 3.16.

Tip: For large data sets, a variance calculator online saves time during data cleaning and before hypothesis testing. But knowing how to calculate variance by hand helps you understand what the numbers mean — and catches errors when tools give unexpected results.

Variance in common tools

Excel / Google Sheets =VAR.S(A1:A5) for sample, =VAR.P(A1:A5) for population
Python (NumPy) np.var(data, ddof=1) for sample, np.var(data) for population
R var(x) returns sample variance by default
TI-84 Calculator STAT → CALC → 1-Var Stats shows σ² and s²
Quick Reference

Summary of Variables and Equations

Every symbol used in variance formulas, in one place. Click any variable to see its definition and the equations it appears in.

Symbol Connection Map

Click a variable below. Connected equations will highlight, showing where that symbol fits in the variance equation.

xᵢ μ n σ²
xᵢ
Data Value (each individual observation)
Each data point in the data set. In [4, 8, 6, 5], x₁ = 4, x₂ = 8, x₃ = 6, x₄ = 5. The subscript "i" refers to the position of that value. This is the discrete random variable input to the variance formula.
Used in: s² = Σ(xᵢ − x̄)² / (n−1) σ² = Σ(xᵢ − μ)² / n

Complete Equation Reference

Sample Variance
s² = Σ(xᵢ − x̄)² / (n − 1)
Population Variance
σ² = Σ(xᵢ − μ)² / n
Sample Std. Deviation
s = √[Σ(xᵢ − x̄)² / (n − 1)]
Population Std. Deviation
σ = √[Σ(xᵢ − μ)² / n]
Mean (Average)
x̄ = Σxᵢ / n
Coefficient of Variation
CV = (σ / μ) × 100%
Discrete Random Variable Variance
Var(X) = Σ[xᵢ² · P(xᵢ)] − μ²
Variance of Linear Combination
Var(aX + b) = a² · Var(X)
Full Population

Whole Population Variance Calculation

When the data set includes every member of the group, use population variance — divide by n, not n − 1.

Population variance applies when your data set includes every observation from the whole population — not a sample. Examples: all employees in a company, every test score in a class, all products in a batch during quality control. The formula uses μ (the true population mean) and divides by n (the full count). No Bessel's correction. No degrees of freedom adjustment.

Interactive: How Sample Size Affects Variance

Drag the slider to see how the difference between σ² and s² changes with population size. At small n, the gap is large. As n grows, sample variance converges toward population variance.

Population size (n): 5
3 100
Population σ²
Sum of Squares / 5
Sample s²
Sum of Squares / 4
Difference
s² − σ²

Convergence: s² approaches σ² as n grows

% n 0% 50% 100% 3 25 50 75 100

At n = 3, sample variance is 50% larger than population variance. At n = 100, the difference is just 1%. This is why the choice between population and sample variance matters most for small data sets.

How much s² exceeds σ²
At n = 5, sample variance is 25% larger than population variance

When you have the whole population

🏫
Educational assessments — Every student in a class took the exam. You have all the scores. Use σ².
🏭
Process optimization — You measured every product in a production batch during quality control. The data set is complete. Use σ².
📋
Inventory management — All SKUs in a warehouse are counted. No sampling. Population variance gives the exact spread.
📊
Demographic studies — Census data covers every resident. With the whole population measured, σ² is the right choice.
FAQ

Frequently Asked Questions — Standard Deviation Calculator

Everything you need to know about standard deviation.

What is the standard deviation of 1, 2, 3, 4, 5?

The standard deviation of 1, 2, 3, 4, 5 is calculated as follows. Mean = 3. Squared deviations: 4, 1, 0, 1, 4. Sum of squares = 10. Population standard deviation (σ) = √(10/5) = √2 ≈ 1.414. Sample standard deviation (s) = √(10/4) = √2.5 ≈ 1.581. Use population SD if these are all your data points; use sample SD if they represent a sample from a larger group.

How do you calculate standard deviation step by step?

To calculate standard deviation step by step: 1. Find the mean (average) of your data set. 2. Subtract the mean from each value to get deviations. 3. Square each deviation. 4. Find the average of squared deviations (divide by n for population, n−1 for sample). This gives you the variance. 5. Take the square root of the variance. The result is the standard deviation. Our calculator shows every step automatically.

What is the difference between standard deviation and variance?

Standard deviation is the square root of variance. Variance measures spread in squared units, while standard deviation converts it back to the original units of your data. For example, if your data is in meters, variance is in meters², but standard deviation is in meters. Standard deviation is generally easier to interpret because it uses the same scale as the raw data.

How to calculate standard deviation in Excel?

In Excel, use STDEV.S(range) for sample standard deviation and STDEV.P(range) for population standard deviation. Example: =STDEV.S(A1:A10). In Google Sheets, the same functions work. In Python, use np.std(data, ddof=1) for sample SD. In R, sd(x) returns sample standard deviation by default.

What is a good standard deviation?

There is no universally "good" standard deviation — it depends on context. A low standard deviation means data points cluster tightly around the mean (more consistent). A high standard deviation means data is widely spread (more variable). In quality control, low SD is preferred for consistency. In investing, higher SD indicates more risk. Use the coefficient of variation (CV) to compare spread across datasets with different scales.

Can standard deviation be negative?

No, standard deviation can never be negative. It is the square root of variance, and variance is always zero or positive (because it sums squared differences). A standard deviation of 0 means all values are identical. Any spread in the data produces a positive standard deviation.