Standard Deviation Calculator
Calculate sample or population standard deviation, variance and mean.
Results update as you type.
About this calculator
Standard deviation measures how spread out a data set is around its mean: a small value means the numbers cluster tightly near the average, a large one means they are widely scattered. This calculator computes both the sample standard deviation (dividing the sum of squared deviations by n − 1, Bessel’s correction) and the population standard deviation (dividing by n), and reports the variance, mean, range and the sum of squared deviations it used. Choose sample when your numbers are a subset drawn from a larger group, and population when they are the entire group.
The method has four steps: find the mean, subtract it from each value to get the deviations, square those deviations and add them up, then divide by n − 1 (sample) or n (population) and take the square root. The square root returns the answer to the same units as the original data, which is why standard deviation is usually preferred over variance for interpretation.
Worked example: for 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5. The squared deviations sum to 32, so the population variance is 32 ÷ 8 = 4 and the population standard deviation is √4 = 2; the sample version divides 32 by 7, giving about 4.57 and a standard deviation of roughly 2.14. The deviation table below shows each value’s distance from the mean and its squared deviation so you can follow the calculation.
Frequently asked questions
What is the difference between sample and population standard deviation?
The population formula divides the summed squared deviations by n; the sample formula divides by n − 1. The n − 1 (Bessel’s correction) compensates for the fact that a sample tends to underestimate the true spread of the population it came from.
Why square the deviations?
Squaring makes every deviation positive so they do not cancel out, and it weights larger deviations more heavily. Taking the square root at the end returns the measure to the original units of the data.
How do I calculate standard deviation by hand?
Find the mean, subtract it from each value to get the deviations, square each deviation and add them up, then divide by n − 1 for a sample or n for a population and take the square root of that result.
What is a good standard deviation?
There is no universal "good" value — it depends entirely on the scale and context of your data. A standard deviation is only meaningful next to the mean; the same spread that is tiny for house prices could be enormous for test scores. The coefficient of variation expresses it as a percentage of the mean for comparison.
Can the standard deviation be zero or negative?
It can be zero, which happens only when every value is identical and there is no spread at all. It can never be negative, because it is the square root of an average of squared numbers.
Why does the sample calculation need at least two values?
The sample formula divides by n − 1, so a single value would divide by zero and is left undefined. A sample standard deviation only makes sense once you have two or more observations to compare.
API — use this calculator from code
Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →
Endpoint
GET https://calculator.free/api/v1/standard-deviation/
curl
curl "https://calculator.free/api/v1/standard-deviation/?numbers=9, 2, 5, 4, 12, 7, 8, 11, 9, 3, 7, 4, 12, 5, 4, 10, 9, 6, 9, 4&type=sample"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/standard-deviation/?" + new URLSearchParams({
"numbers": "9, 2, 5, 4, 12, 7, 8, 11, 9, 3, 7, 4, 12, 5, 4, 10, 9, 6, 9, 4",
"type": "sample"
}));
const data = await r.json();
console.log(data.results);
Results are estimates for general guidance only, not financial, medical or tax advice.