Standard Deviation Calculator
Free standard deviation calculator for any data set. Get variance, mean, and more with population and sample modes plus step-by-step breakdowns.
Enter a set of numbers and this calculator computes the standard deviation, variance, mean, sum, count, minimum, maximum, and range. It shows both population and sample results with a step-by-step breakdown of the calculation so you can follow the method or verify your work.
About Standard Deviation Calculator
What Standard Deviation Tells You
Standard deviation (often written as sigma or s) measures how spread out a set of numbers is from their average. A low standard deviation means the values cluster tightly around the mean. A high standard deviation means they are spread out.
Example: Two classes both average 75% on a test:
- Class A scores: 73, 74, 75, 76, 77. Standard deviation = 1.41. Very consistent.
- Class B scores: 50, 65, 75, 85, 100. Standard deviation = 17.68. Huge variation.
The average alone does not tell the full story. Standard deviation reveals how representative that average actually is.
The Formula Step by Step
For a data set of n values (x1, x2, ..., xn):
- Calculate the mean:
mean = (x1 + x2 + ... + xn) / n - Find each deviation from the mean:
di = xi - mean - Square each deviation:
di^2 - Sum the squared deviations:
SS = d1^2 + d2^2 + ... + dn^2 - Divide by n (population) or n-1 (sample) to get variance:
variance = SS / norSS / (n-1) - Take the square root to get standard deviation:
SD = sqrt(variance)
Worked example: Data set: 4, 8, 6, 5, 3
Mean = (4 + 8 + 6 + 5 + 3) / 5 = 26 / 5 = 5.2
Deviations: -1.2, 2.8, 0.8, -0.2, -2.2
Squared: 1.44, 7.84, 0.64, 0.04, 4.84
Sum of squares: 14.8
Population variance: 14.8 / 5 = 2.96. Population SD: sqrt(2.96) = 1.72
Sample variance: 14.8 / 4 = 3.70. Sample SD: sqrt(3.70) = 1.92
Population vs. Sample: When to Use Which
This is one of the most common sources of confusion in statistics:
| Use Population (divide by n) | Use Sample (divide by n-1) |
|---|---|
| Your data includes every member of the group | Your data is a subset of a larger group |
| All students in a class | A random sample of students from a school |
| All sales in a month | A sample of customer transactions |
| Every measurement in an experiment | A subset of measurements to estimate the whole |
| Symbol: sigma (lowercase) | Symbol: s |
The reason sample SD divides by n-1 (called Bessel's correction) is that a sample tends to underestimate the true population spread. Dividing by n-1 compensates for this bias. For large sample sizes (n > 30), the difference between n and n-1 becomes negligible.
How to Interpret Standard Deviation
For normally distributed data (the classic bell curve), standard deviation has a precise interpretation:
- 68% of values fall within 1 standard deviation of the mean
- 95% of values fall within 2 standard deviations of the mean
- 99.7% of values fall within 3 standard deviations of the mean
This is called the 68-95-99.7 rule (or empirical rule). It is why "within two standard deviations" is often used as a rough boundary for what is normal.
Example: If exam scores have a mean of 70 and SD of 10:
- 68% of students scored between 60 and 80
- 95% scored between 50 and 90
- 99.7% scored between 40 and 100
- A score of 95 is 2.5 standard deviations above the mean, which is quite rare
Standard Deviation in Real Life
| Context | What SD Measures | Why It Matters |
|---|---|---|
| Manufacturing | Variation in product dimensions | Lower SD = more consistent quality |
| Finance | Volatility of stock returns | Higher SD = riskier investment |
| Weather | Temperature variation | Coastal cities have lower SD than inland |
| Sports | Consistency of performance | Lower SD = more reliable player |
| Testing | Score spread on an exam | High SD may indicate the test differentiates well |
In finance, standard deviation is the primary measure of risk. A stock with an annual return SD of 20% is twice as volatile as one with 10%. This is why portfolio diversification works: combining uncorrelated assets reduces the overall portfolio SD.
Related Measures of Spread
Standard deviation is one of several ways to describe spread, and each has a different strength depending on the data:
- Variance: The square of standard deviation. Useful in many statistical formulas (ANOVA, regression) but harder to interpret because it is in squared units.
- Range: The simplest measure of spread (max minus min). Easy to compute but very sensitive to outliers.
- Interquartile range (IQR): The range of the middle 50% of data (Q3 minus Q1). More robust to outliers than range or SD, which is why IQR is used in box plots.
- Mean absolute deviation (MAD): Average of the absolute deviations from the mean. Less influenced by extreme values than SD because it does not square the deviations.
- Coefficient of variation (CV): SD divided by the mean, expressed as a percentage. Useful for comparing spread across data sets with different scales or units.
Common Mistakes When Calculating Standard Deviation
The formula is well defined but easy to mis-apply. These are the errors that crop up most often in statistics courses and spreadsheet work:
- Using the wrong divisor. In Excel,
STDEV.Pdivides by n andSTDEV.Sdivides by n-1. Picking the wrong one silently biases every downstream calculation. The olderSTDEVfunction is sample SD (n-1), which trips up people expecting population SD. - Forgetting to square the deviations. If you sum the raw deviations from the mean, the answer is always zero. Squaring is what makes the formula work.
- Averaging two standard deviations directly. SDs do not average like means. To combine two groups you need a pooled variance formula that weights by sample size.
- Applying the 68-95-99.7 rule to skewed data. The empirical rule only holds for roughly normal distributions. For skewed data (income, house prices, reaction times) Chebyshev's inequality is a safer bound: at least 75% of values lie within 2 SDs, at least 89% within 3 SDs, regardless of distribution shape.
- Comparing SDs across different scales. A stock with an SD of 5 and a bond with an SD of 0.5 may have similar relative volatility. Use the coefficient of variation when the means differ.
Standard Deviation in Finance and Investing
In finance, standard deviation is the textbook definition of risk. A fund's SD of annual returns is the headline figure in most fact sheets. According to data published by SPIVA and S&P Dow Jones Indices, the long-run annualised standard deviation of the S&P 500 is roughly 15-16%, while 10-year US Treasury bond returns sit closer to 5-7%. That gap is why equities earn the equity risk premium - investors are being paid to hold volatility.
Standard deviation is also the input to several derived risk metrics:
- Sharpe ratio: (portfolio return - risk-free rate) / portfolio SD. Measures excess return per unit of volatility.
- Value at Risk (VaR): Uses SD and a normality assumption to estimate maximum expected loss at a given confidence level.
- Bollinger Bands: Price bands plotted at 2 SDs above and below a 20-day moving average. Widely used in technical analysis to identify volatility expansion.
- Beta: A stock's covariance with the market divided by market variance. Beta and SD together describe systematic vs total risk.
One trap: SD treats upside and downside volatility symmetrically, even though investors only really fear the downside. Sortino ratio and semi-deviation try to fix this by looking only at negative returns. Academic research from the CFA Institute has documented that semi-deviation gives a cleaner view of downside risk for skewed return distributions.
Standard Deviation in Quality Control and Science
Manufacturing and science use standard deviation to define what counts as acceptable variation. Six Sigma processes, for example, aim to produce no more than 3.4 defects per million opportunities, which corresponds to tolerances of roughly plus or minus six standard deviations from the target. The discipline was pioneered at Motorola in the 1980s and popularised by GE in the 1990s.
In physics and chemistry experiments, reported measurements usually carry an uncertainty expressed as one standard deviation (often written mean plus or minus sigma). Particle physics uses a higher bar: a "five sigma" result means the observed effect has a probability of about 1 in 3.5 million of occurring by chance under the null hypothesis. That is the threshold CERN used when announcing the discovery of the Higgs boson in 2012.
Clinical trials and medical research typically quote results in terms of standard errors (SD divided by sqrt(n)) rather than raw SD, because the standard error shrinks as sample size grows and is what drives the width of 95% confidence intervals.
Tips for Using This Calculator
- Clean your data first. Remove or flag outliers before trusting the SD - a single data entry error can inflate the result dramatically because deviations are squared.
- Paste freely. The input box accepts numbers separated by commas, spaces, or line breaks, so you can paste directly from a spreadsheet column.
- Use sample SD by default. Unless you are certain your data covers the entire population, sample SD (divide by n-1) is the correct choice. Textbooks and most research papers quote sample SD.
- Expand the step-by-step view to see the mean, each deviation, and each squared deviation. This is the fastest way to catch typos in an input set or to double-check your homework.
- Combine with related stats. SD on its own is only one number. Pair it with the mean, min, max, and range to get a full picture of the distribution.
For simpler central tendency calculations, the average calculator provides mean, median, and mode. For z-score conversions (how many SDs a value is from the mean), use the z-score calculator. To find confidence intervals from your data, try the confidence interval calculator.
All calculations run in your browser. No data is stored or transmitted.
Sources
Frequently Asked Questions
What is the difference between population and sample standard deviation?
Population standard deviation is used when your data set includes every member of the group you are studying. It divides by N (the total count). Sample standard deviation is used when your data is a subset of a larger population. It divides by N-1 (called Bessel's correction) to produce an unbiased estimate. If you are unsure which to use, sample standard deviation is typically the safer choice.
How is standard deviation calculated?
Standard deviation is calculated in several steps: first, find the mean (average) of your data. Then subtract the mean from each value and square the result. Next, find the average of those squared differences (dividing by N for population or N-1 for sample). Finally, take the square root of that average. The result tells you how spread out the values are from the mean.
What does a high or low standard deviation mean?
A low standard deviation means the data points are clustered closely around the mean, indicating low variability. A high standard deviation means the data points are spread out over a wider range. For example, test scores of 78, 80, 79, 81 have a low SD, while scores of 50, 95, 60, 100 have a high SD, even if both sets have a similar average.
Can I use this calculator for my homework or research?
Yes. This calculator performs the same formulas used in statistics courses and research. It shows step-by-step calculations so you can verify the work and understand each part of the process. All calculations run in your browser and no data is sent to any server.
What is variance and how does it relate to standard deviation?
Variance is the average of the squared differences from the mean. Standard deviation is simply the square root of variance. Variance is useful in many statistical formulas, but standard deviation is often preferred for interpretation because it is expressed in the same units as the original data.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/standard-deviation-calculator/" title="Standard Deviation Calculator - Free Online Tool">Try Standard Deviation Calculator on ToolboxKit.io</a>