Standard Deviation Calculator
Calculate the sample or population standard deviation and variance of a dataset, with the mean, a table of deviations and every step shown.
Sample (divide by n − 1)Selected
- Standard deviation (s)
- 2.581989
- Variance (s²)
- 6.666667
Population (divide by N)
- Standard deviation (σ)
- 2.236068
- Variance (σ²)
- 5
- Count
- 4
- Mean
- 5
- Sum
- 20
- Σ(x − mean)²
- 20
- Sum of squares
- Minimum
- 2
- Maximum
- 8
- Range
- 6
What this standard deviation means
Your sample standard deviation is 2.581989. As a rough guide, values typically sit about 2.581989 units from the mean of 5: some are closer and some are farther. It summarises the spread of the whole dataset rather than the distance of any one value.
2 of 4 values (50%) lie within one standard deviation of the mean, between 2.418011 and 7.581989.
Relative to the mean, the spread is 51.6% (the coefficient of variation), which helps compare datasets measured on different scales.
Spread around the mean
Step-by-step calculation (sample)
Step 1: Calculate the mean (x̄)
x̄ = (2 + 4 + 6 + 8) ÷ 4
x̄ = 20 ÷ 4 = 5
Step 2: Find each deviation from the mean
Subtract the mean from each value. Negative deviations are below the mean.
2 − 5 = −3
4 − 5 = −1
6 − 5 = 1
8 − 5 = 3
Step 3: Square each deviation
Squaring makes every deviation positive, so values above and below the mean don’t cancel out.
(−3)² = 9
(−1)² = 1
1² = 1
3² = 9
Step 4: Add the squared deviations: Σ(x − x̄)²
9 + 1 + 1 + 9 = 20
Step 5: Divide by n − 1 to get the sample variance
Dividing by n − 1 instead of n corrects for measuring spread around the sample’s own mean (Bessel’s correction).
s² = 20 ÷ (4 − 1) = 20 ÷ 3 = 6.666667
Step 6: Take the square root to get the standard deviation
s = √6.666667 = 2.581989
Step 7: Answer
Sample standard deviation s = 2.581989
Calculation table
| Value (x) | Deviation (x − mean) | Squared deviation |
|---|---|---|
| 2 | −3 | 9 |
| 4 | −1 | 1 |
| 6 | 1 | 1 |
| 8 | 3 | 9 |
| n = 4 | Σ = 0 | Σ = 20 |
The deviations always add up to 0, which is why they are squared before averaging.
Need the median and mode too? The Average Calculator gives the full summary. To see how many standard deviations one value is from the mean, use the Z-Score Calculator; to estimate a population mean from a sample, the Confidence Interval Calculator.
Standard deviation measures how spread out the values in a dataset are around their mean: a small standard deviation means the values are clustered together, a large one means they are widely spread. This standard deviation calculator works out both the sample standard deviation (s, dividing by n − 1) and the population standard deviation (σ, dividing by N), together with the variance, mean, sum, minimum, maximum and range.
Paste your data or enter a frequency table, choose sample or population, and follow the step-by-step solution and calculation table built from your numbers. A chart shows the values, the mean and the band one standard deviation either side of it.
Standard Deviation Formula
Standard deviation measures how spread out a dataset is around its mean. There are two versions, depending on whether your data is a whole population or a sample from one.
Population standard deviation
σ = √[Σ(xᵢ − μ)² ÷ N]
- σ
- population standard deviation (sigma)
- xᵢ
- each value in the dataset
- μ
- population mean (mu)
- N
- number of values in the population
Sample standard deviation
s = √[Σ(xᵢ − x̄)² ÷ (n − 1)]
- s
- sample standard deviation
- xᵢ
- each value in the sample
- x̄
- sample mean (“x-bar”)
- n
- number of observations in the sample
Σ means “add up”, so Σ(xᵢ − x̄)² is the sum of the squared distances from the mean. The expression under the square root is the variance; the standard deviation is its square root.
Why does the sample formula divide by n − 1?
A sample’s values are, on average, a little closer to their own mean than to the true population mean, because the sample mean is calculated from those same values. Dividing by n would therefore underestimate the population’s spread. Dividing by the slightly smaller n − 1 (Bessel’s correction) makes the sample variance an unbiased estimate of the population variance. The difference matters most for small samples: with 4 values you divide by 3 instead of 4, but with 1,000 values the two results are almost identical.
Sample vs Population Standard Deviation
| Population (σ) | Sample (s) | |
|---|---|---|
| Use when | You have every member of the group | Your data is a subset used to learn about a larger group |
| Divide by | N | n − 1 |
| Minimum data | 1 value | 2 values |
| For 2, 4, 6, 8 | √(20 ÷ 4) ≈ 2.2361 | √(20 ÷ 3) ≈ 2.5820 |
| Spreadsheet function | STDEV.P | STDEV.S |
If you are unsure, you probably have a sample: survey responses, experimental measurements and quality checks are almost always samples from something larger. The sample value is always slightly larger than the population value for the same data.
Variance vs Standard Deviation
Variance = (standard deviation)² Standard deviation = √variance
Standard deviation
- The square root of the variance
- In the same units as the data (cm, points, %)
- Easier to read as a typical amount of spread
Variance
- The average squared deviation
- In squared units (cm², points²)
- Convenient in calculations: variances of independent quantities add, which is used in ANOVA and regression
Neither is better; they carry the same information. A related measure, the mean absolute deviation, averages the distances from the mean without squaring them. It is simpler to explain but gives less weight to large deviations, so it is usually smaller than the standard deviation for the same data.
How to Calculate Standard Deviation
- Find the mean. For 10, 20, 30: 60 ÷ 3 = 20
- Subtract the mean from each value: −10, 0, 10
- Square each deviation: 100, 0, 100
- Add the squares: 200
- Divide by N for a population (200 ÷ 3 ≈ 66.67) or by n − 1 for a sample (200 ÷ 2 = 100). This is the variance.
- Take the square root: population σ ≈ 8.165, sample s = 10.
How Outliers Affect Standard Deviation
Compare dataset A, 10, 11, 12, 13, 14, with dataset B, 10, 11, 12, 13, 100. Their population standard deviations are about 1.41 and 35.41. Only one value changed, but it now sits 70.8 above the new mean of 29.2, and squaring that deviation gives about 5,013, which makes up nearly all of the sum of squares (6,270.8).
Because deviations are squared, a single extreme value can dominate the standard deviation. A large standard deviation doesn’t prove there is an outlier, though: it can also mean the data is genuinely widely spread. Look at the values themselves (the chart above helps), and consider the median and interquartile range for skewed data.
Standard Deviation Examples
Test scores
Scores: 70, 75, 80, 85, 90
σ = √[Σ(x − μ)² ÷ N], s = √[Σ(x − x̄)² ÷ (n − 1)]
Mean = 400 ÷ 5 = 80
Deviations: −10, −5, 0, 5, 10
Squares: 100 + 25 + 0 + 25 + 100 = 250
Population: 250 ÷ 5 = 50, √50 ≈ 7.07
Sample: 250 ÷ 4 = 62.5, √62.5 ≈ 7.91
σ ≈ 7.07 points (whole class) · s ≈ 7.91 points (sample)
Use the population value if these are all the scores you care about, and the sample value if they are a sample used to estimate the spread for all students.
Manufacturing consistency
Part lengths (mm): 9.8, 10.1, 10.0, 9.9, 10.2
s = √[Σ(x − x̄)² ÷ (n − 1)]
Mean = 50 ÷ 5 = 10.0
Squares: 0.04 + 0.01 + 0 + 0.01 + 0.04 = 0.10
s² = 0.10 ÷ 4 = 0.025
s = √0.025 ≈ 0.158
s ≈ 0.16 mm
The parts typically vary by about 0.16 mm around 10 mm, only about 1.6% of the target length. A lower standard deviation means a more consistent process.
Investment returns
Yearly returns (%): Fund A 6, 7, 5, 8, 4 · Fund B 15, −5, 20, −10, 10
s = √[Σ(x − x̄)² ÷ (n − 1)]
Both funds average 6% a year
Fund A: Σ(x − x̄)² = 10, s² = 10 ÷ 4 = 2.5, s ≈ 1.58%
Fund B: Σ(x − x̄)² = 670, s² = 670 ÷ 4 = 167.5, s ≈ 12.94%
Fund A s ≈ 1.58% · Fund B s ≈ 12.94%
Same average, very different variability: Fund B’s yearly returns swing much further from the mean. Volatility is one part of investment risk, not the whole picture, and past variability doesn’t guarantee future results.
A dataset with an outlier
10, 11, 12, 13, 14 compared with 10, 11, 12, 13, 50
σ = √[Σ(x − μ)² ÷ N]
First set: mean 12, Σ(x − μ)² = 10, σ = √2 ≈ 1.41
Second set: mean 19.2, Σ(x − μ)² = 1,190.8, σ = √238.16 ≈ 15.43
σ rises from 1.41 to 15.43
Changing one value from 14 to 50 makes the standard deviation about 11 times larger, because its deviation (30.8) is squared (≈ 949) and dominates the sum.
How to Interpret Standard Deviation
- A low standard deviation means the values are clustered close to the mean: consistent test scores, a precise machine, stable returns.
- A high standard deviation means the values are spread out: some are far above or below the mean.
- Zero means every value is identical. Standard deviation can never be negative, because it is the square root of an average of squares.
- It is in the data’s units, so “high” depends on the scale: a standard deviation of 5 is large for shoe sizes and tiny for house prices. Dividing by the mean (the coefficient of variation) helps compare different scales.
For data that is roughly bell-shaped (normally distributed), about 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. That rule doesn’t hold for skewed data. To place a single value on this scale, use the Z-Score Calculator; to summarise the centre of the data, the Average Calculator; and to turn a spread into a range for the true mean, the Confidence Interval Calculator.
How to Use the Standard Deviation Calculator
- Choose Sample if your data is a sample from a larger group, or Population if it includes every member of the group. The results panel shows both, with your choice highlighted.
- Type or paste your values separated by commas, spaces or new lines, or switch to Frequency table and enter each value with how many times it occurs.
- Pick how many decimal places to display. Calculations always use full precision; only the displayed numbers are rounded.
- Read the standard deviation and variance, the interpretation and the chart showing the mean and the band one standard deviation either side of it.
- Check the step-by-step calculation and the table of deviations and squared deviations, which use your numbers.
Frequently Asked Questions
What is standard deviation?
Standard deviation is a measure of spread: roughly, how far the values in a dataset typically are from their mean. It is the square root of the variance, so it is in the same units as the data.
How do you calculate standard deviation?
Find the mean, subtract it from each value, square those deviations and add them up. Divide by N for a population or by n − 1 for a sample to get the variance, then take the square root. For 2, 4, 6, 8: the squares add to 20, so σ = √(20 ÷ 4) ≈ 2.236 and s = √(20 ÷ 3) ≈ 2.582.
What is the difference between sample and population standard deviation?
Population standard deviation (σ) divides the sum of squared deviations by N and describes a complete group. Sample standard deviation (s) divides by n − 1 and estimates the spread of a larger population from a sample. The sample value is slightly larger for the same data.
Why does sample standard deviation use n − 1?
Values in a sample are, on average, closer to their own mean than to the true population mean, so dividing by n would underestimate the spread. Dividing by n − 1 (Bessel’s correction) makes the sample variance an unbiased estimate of the population variance.
What does a high standard deviation mean?
The values are widely spread out from the mean. Whether a value is “high” depends on the units and scale of the data, so it helps to compare it with the mean (the coefficient of variation) or with similar datasets.
What does a low standard deviation mean?
The values are clustered closely around the mean, which indicates consistency, such as precise measurements or similar test scores. A standard deviation of 0 means every value is identical.
What is the difference between variance and standard deviation?
Variance is the average squared deviation from the mean, in squared units; standard deviation is its square root, in the original units. Variance = standard deviation², so a standard deviation of 3 cm means a variance of 9 cm².
Can standard deviation be negative?
No. It is the square root of an average of squared numbers, so it is always 0 or positive. It is 0 only when every value is the same.
How many values are needed to calculate sample standard deviation?
At least two. With one value, n − 1 = 0 and the sample formula would divide by zero. The population standard deviation of a single value is 0.
How does an outlier affect standard deviation?
Strongly, because deviations are squared. Changing 14 to 100 in 10, 11, 12, 13, 14 raises the population standard deviation from about 1.41 to about 35.41. A large standard deviation alone doesn’t prove there is an outlier, so look at the data too.
Related Calculators
Average Calculator
Calculate the average (mean) of a list of numbers with the median, mode and range, or a weighted average, with step-by-step working.
Z-Score Calculator
Calculate a z-score from a value, mean and standard deviation, with the steps, what it means, a bell-curve chart and the normal-distribution percentile.
Confidence Interval Calculator
Calculate a confidence interval for a population mean from the sample mean, standard deviation and sample size, using t or z, with the margin of error and every step.
Sample Size Calculator
Find the minimum sample size for a survey from the confidence level, margin of error, expected proportion and optional population size, with every step shown.
Percentage Calculator
Calculate percentages, percent of a number, and percentage changes fast.
T-Test Calculator
Run a one-sample, independent two-sample (Welch or pooled) or paired t-test from raw data or summary statistics, with the p-value, confidence interval and every step.
Last updated: September 29, 2026.