Loading
Calculate standard deviation instantly with full steps. Supports sample & population SD, grouped data & relative SD. Free, accurate, no signup — try it now.
Provide numbers separated by commas to calculate the standard deviation, variance, mean, sum, and margin of error.
Math
Last updated: April 2026 | Accurate for sample SD, population SD, grouped data, and relative standard deviation
Knowing the average of a dataset is useful. Knowing how spread out the data is around that average is often more useful. Standard deviation quantifies exactly that — it measures how much individual values in a dataset deviate from the mean, giving you a single number that captures the variability, consistency, or risk embedded in your data.
A standard deviation calculator computes that number instantly, with every step shown — mean calculation, individual deviations, squared deviations, variance, and the final standard deviation — so you understand the result, not just the answer.
Whether you're a student working through statistics homework, a financial analyst assessing investment risk, a quality control engineer measuring manufacturing consistency, or a researcher summarising experimental data — this calculator handles sample and population standard deviation, grouped frequency data, and relative standard deviation in one tool.
📊 Calculate Standard Deviation Now → Standard Deviation Calculator
✅ Free and instant | ✅ Sample and population modes | ✅ Full step-by-step working | ✅ Grouped data support
The standard deviation calculator is a complete descriptive statistics tool — not just a single-formula output.
It calculates:
It shows:
Direct answer: Standard deviation is a measure of how spread out the values in a dataset are around the mean. A low standard deviation means values cluster close to the mean. A high standard deviation means values are widely spread.
It is the square root of the variance, and it's expressed in the same unit as the original data — making it directly interpretable in context.
| Dataset | Mean | SD | Interpretation |
|---|---|---|---|
| 10, 10, 10, 10, 10 | 10 | 0 | No variation — identical values |
| 9, 10, 10, 11, 10 | 10 | ~0.7 | Very low spread |
| 5, 8, 10, 12, 15 | 10 | ~3.5 | Moderate spread |
| 1, 5, 10, 15, 19 | 10 | ~6.6 | High spread |
| 0, 0, 10, 20, 20 | 10 | ~8.9 | Very high spread |
Imagine two teachers both report an average class test score of 70%.
Same average. Very different reality. Standard deviation reveals the difference that the mean conceals.
Used when your dataset is the entire population — every observation you care about is included.
σ = √[ Σ(x − μ)² ÷ N ]
Where:
Used when your dataset is a sample drawn from a larger population — you're using the sample to estimate the population's standard deviation.
s = √[ Σ(x − x̄)² ÷ (n − 1) ]
Where:
This is one of the most commonly misunderstood points in introductory statistics.
When you calculate a sample mean (x̄) and then measure deviations from it, those deviations will naturally be slightly smaller than deviations from the true population mean — because the sample mean is calculated to minimise those very deviations. Dividing by (n−1) instead of n compensates for this systematic underestimation, producing an unbiased estimator of the population variance.
In practice: for large samples (n > 30), the difference between dividing by n and (n−1) is negligible. For small samples, it matters — and using n when you should use (n−1) will consistently underestimate variability.
| Type | Formula | Denominator | When to Use |
|---|---|---|---|
| Population SD (σ) | √[Σ(x−μ)²/N] | N | You have all data (entire population) |
| Sample SD (s) | √[Σ(x−x̄)²/(n−1)] | n−1 | You have a sample of a larger group |
| Variance (population) | Σ(x−μ)²/N | N | Population variance (SD²) |
| Variance (sample) | Σ(x−x̄)²/(n−1) | n−1 | Sample variance (SD²) |
| Relative SD (RSD%) | (SD/Mean)×100 | — | Comparing variability across scales |
Dataset: 4, 8, 6, 5, 3, 2, 8, 9, 2, 5
Step 1 — Calculate the mean (μ): Sum = 4+8+6+5+3+2+8+9+2+5 = 52 N = 10 μ = 52 ÷ 10 = 5.2
Step 2 — Calculate each value's deviation from the mean (x − μ):
| Value (x) | x − μ |
|---|---|
| 4 | 4 − 5.2 = −1.2 |
| 8 | 8 − 5.2 = +2.8 |
| 6 | 6 − 5.2 = +0.8 |
| 5 | 5 − 5.2 = −0.2 |
| 3 | 3 − 5.2 = −2.2 |
| 2 | 2 − 5.2 = −3.2 |
| 8 | 8 − 5.2 = +2.8 |
| 9 | 9 − 5.2 = +3.8 |
| 2 | 2 − 5.2 = −3.2 |
| 5 | 5 − 5.2 = −0.2 |
Step 3 — Square each deviation (x − μ)²:
| Value | Deviation | Squared |
|---|---|---|
| 4 | −1.2 | 1.44 |
| 8 | +2.8 | 7.84 |
| 6 | +0.8 | 0.64 |
| 5 | −0.2 | 0.04 |
| 3 | −2.2 | 4.84 |
| 2 | −3.2 | 10.24 |
| 8 | +2.8 | 7.84 |
| 9 | +3.8 | 14.44 |
| 2 | −3.2 | 10.24 |
| 5 | −0.2 | 0.04 |
| Sum | 57.60 |
Step 4 — Calculate variance (population): σ² = 57.60 ÷ 10 = 5.76
Step 5 — Take the square root: σ = √5.76 = 2.4
Population standard deviation = 2.4 ✓
Dataset: 2, 4, 6 (a sample of three values)
Step 1 — Mean: x̄ = (2+4+6) ÷ 3 = 4
Step 2 — Deviations: 2−4 = −2 | 4−4 = 0 | 6−4 = +2
Step 3 — Squared deviations: (−2)² = 4 | 0² = 0 | 2² = 4
Step 4 — Sum of squared deviations: 4 + 0 + 4 = 8
Step 5 — Sample variance (divide by n−1): s² = 8 ÷ (3−1) = 8 ÷ 2 = 4
Step 6 — Sample standard deviation: s = √4 = 2
Sample SD = 2 ✓
Dataset: 12, 15, 18, 22, 25, 28, 30 (sample)
Mean: (12+15+18+22+25+28+30) ÷ 7 = 150 ÷ 7 = 21.43
| x | x − x̄ | (x − x̄)² |
|---|---|---|
| 12 | −9.43 | 88.92 |
| 15 | −6.43 | 41.34 |
| 18 | −3.43 | 11.76 |
| 22 | +0.57 | 0.32 |
| 25 | +3.57 | 12.74 |
| 28 | +6.57 | 43.16 |
| 30 | +8.57 | 73.44 |
| Sum | 271.68 |
Sample variance: 271.68 ÷ (7−1) = 271.68 ÷ 6 = 45.28
Sample SD: √45.28 = 6.73 ✓
This is the most frequently confused distinction in statistics — and getting it wrong produces systematically biased results.
| Feature | Population SD (σ) | Sample SD (s) |
|---|---|---|
| Used when | You have ALL data | You have a SUBSET of data |
| Formula denominator | N | n − 1 |
| Purpose | Describes the population | Estimates the population |
| Result vs population | Exact | Unbiased estimate |
| Excel function | =STDEV.P() | =STDEV.S() |
Use Population SD (σ) when:
Use Sample SD (s) when:
Rule of thumb: If in doubt, use sample SD (n−1). It's the more conservative choice and is appropriate for any situation where your data could be considered a sample of something larger.
The mean sits at the heart of the standard deviation calculation — every deviation is measured from it. This section makes that relationship explicit.
Deviations from the mean will always sum to zero — because the mean is the mathematical balancing point of the data. If we simply averaged the deviations, we'd always get zero, regardless of how spread out the data is.
Squaring the deviations:
Squaring the deviations changes the unit. If your data is in kilograms, the squared deviations are in kg². Taking the square root converts the variance back into the original unit (kg), making the standard deviation directly interpretable alongside the mean and the original data values.
Grouped data presents values in class intervals with associated frequencies — common in statistics homework, census datasets, survey results, and any scenario where individual values aren't recorded, only distribution counts.
Example — Employee age distribution:
| Age Range | Midpoint (x) | Frequency (f) |
|---|---|---|
| 20–30 | 25 | 8 |
| 30–40 | 35 | 15 |
| 40–50 | 45 | 12 |
| 50–60 | 55 | 10 |
| 60–70 | 65 | 5 |
| Total | 50 |
σ = √[ Σf(x − μ̄)² ÷ Σf ]
Where:
Step 1 — Calculate the weighted mean: Σ(f×x) = (8×25) + (15×35) + (12×45) + (10×55) + (5×65) = 200 + 525 + 540 + 550 + 325 = 2,140 Mean = 2,140 ÷ 50 = 42.8
Step 2 — Calculate f(x − μ̄)² for each class:
| Midpoint (x) | f | x − 42.8 | (x − 42.8)² | f(x−42.8)² |
|---|---|---|---|---|
| 25 | 8 | −17.8 | 316.84 | 2,534.72 |
| 35 | 15 | −7.8 | 60.84 | 912.60 |
| 45 | 12 | +2.2 | 4.84 | 58.08 |
| 55 | 10 | +12.2 | 148.84 | 1,488.40 |
| 65 | 5 | +22.2 | 492.84 | 2,464.20 |
| Total | 50 | 7,458.00 |
Step 3 — Calculate variance: σ² = 7,458 ÷ 50 = 149.16
Step 4 — Take square root: σ = √149.16 = 12.21
Population SD of employee ages = 12.21 years ✓
Interpretation: The average employee age is 42.8 years, and most employees fall within approximately 12 years of that average (i.e., typically between ages 31 and 55).
Stock Volatility:
Standard deviation is the primary measure of financial risk. A stock with a high standard deviation of daily returns is volatile — its price swings widely. A low standard deviation stock is stable and predictable.
Example:
| Stock | Mean Daily Return | SD | Assessment |
|---|---|---|---|
| Bond ETF | 0.02% | 0.3% | Very low risk, very stable |
| Blue-chip stock | 0.08% | 1.2% | Moderate risk, steady |
| Growth stock | 0.15% | 3.8% | High risk, volatile |
| Cryptocurrency | 0.5% | 8.5% | Very high risk |
Two investments might offer similar average returns — but an SD of 1.2% vs 3.8% represents dramatically different risk profiles. Standard deviation makes that risk tangible and comparable.
For broader investment planning, our Compound Interest Calculator models return scenarios, and our Savings Goal Calculator helps plan portfolio targets.
Understanding class performance:
| Dataset | Mean Score | SD | Interpretation |
|---|---|---|---|
| 68, 70, 72, 69, 71 | 70 | 1.4 | Tight cluster — consistent performance |
| 45, 60, 70, 80, 95 | 70 | 17.9 | Wide spread — mixed ability group |
| 70, 70, 70, 70, 70 | 70 | 0 | Identical scores — no variation |
An SD of 1.4 vs 17.9 on the same mean score of 70 represents completely different classroom dynamics. A teacher seeing SD = 17.9 knows they have a highly mixed-ability class that may require differentiated instruction.
Quality control — measuring product consistency:
A factory produces bolts that should be 50mm long. Testing a sample of 8 bolts:
Lengths: 49.8, 50.2, 50.0, 49.9, 50.1, 50.3, 49.7, 50.0
Mean = 50.0mm SD = 0.19mm
Interpretation: Bolts vary by about ±0.19mm from the target. For most engineering tolerances, this is acceptable. If SD were 2.0mm, bolts would fail specification regularly — a quality problem requiring process investigation.
In clinical trials, standard deviation describes how consistently a treatment works across patients. A drug with a mean blood pressure reduction of 10 mmHg and SD of 2 mmHg is far more predictable than one with the same mean but SD of 8 mmHg — where some patients experience little benefit and others experience large reductions.
The Relative Standard Deviation (RSD) — also called the Coefficient of Variation (CV) — expresses the standard deviation as a percentage of the mean. It allows comparison of variability between datasets that have different units, scales, or magnitudes.
Formula: RSD (%) = (Standard Deviation ÷ Mean) × 100
You cannot directly compare standard deviations across datasets measured in different units or at different scales.
Example — Why absolute SD comparison fails:
| Dataset | Mean | SD | Comparable? |
|---|---|---|---|
| Employee salaries ($) | $55,000 | $8,000 | SD in dollars |
| Employee ages (years) | 38 years | 7 years | SD in years |
An SD of $8,000 vs 7 years means nothing as a direct comparison. RSD solves this:
Now comparable: Age shows slightly more relative variability than salary in this workforce — a meaningful insight for HR planning.
| RSD Value | Interpretation |
|---|---|
| < 5% | Very low variability — highly consistent |
| 5–15% | Low to moderate variability — acceptable in most contexts |
| 15–30% | Moderate to high variability |
| > 30% | High variability — significant spread relative to mean |
| > 50% | Very high variability — data may be highly skewed or mixed |
RSD is extensively used in laboratory science to measure the precision of repeated measurements. A method with RSD < 5% for repeated assays of the same sample is considered precise. RSD > 10% in a pharmaceutical assay would typically trigger investigation.
| Dataset | Mean | Population SD | Sample SD |
|---|---|---|---|
| 2, 4, 6 | 4 | 1.63 | 2.00 |
| 1, 1, 1, 1 | 1 | 0 | 0 |
| 10, 20, 30, 40, 50 | 30 | 14.14 | 15.81 |
| 5, 5, 5, 5, 5, 10 | 5.83 | 1.86 | 2.04 |
| 0, 50, 100 | 50 | 40.83 | 50.00 |
| 3, 7, 7, 19 | 9 | 5.83 | 6.73 |
Excel provides dedicated functions for both population and sample standard deviation.
Formula: =STDEV.S(A1:A10)
Returns the sample standard deviation (n−1 denominator). This is the correct function for research, surveys, and most real-world business use cases. Use this by default unless you specifically have complete population data.
Legacy alternative: =STDEV(A1:A10) — same calculation as STDEV.S but older function name.
Formula: =STDEV.P(A1:A10)
Returns the population standard deviation (N denominator). Use when your dataset represents the entire population — all students in a school, all products in a batch, all employees in a company.
Legacy alternative: =STDEVP(A1:A10) — same calculation.
| Excel Function | Calculates |
|---|---|
| =VAR.S(range) | Sample variance (n−1) |
| =VAR.P(range) | Population variance (N) |
| =STDEV.S(range) | Sample standard deviation |
| =STDEV.P(range) | Population standard deviation |
To replicate the step-by-step calculation and verify results:
Cell A1:A7 — your data values Cell B1: =AVERAGE(A1:A7) — calculate mean Cell C1: =A1-$B$1 — deviation for first value (drag down) Cell D1: =C1^2 — squared deviation (drag down) Cell D8: =SUM(D1:D7) — sum of squared deviations Cell E1 (sample variance): =D8/(COUNT(A1:A7)-1) Cell F1 (sample SD): =SQRT(E1)
This matches =STDEV.S(A1:A7) exactly — and lets you see every intermediate step in your spreadsheet.
In machine learning, standardisation (also called Z-score normalisation) transforms features so they have a mean of 0 and standard deviation of 1:
Z-score = (x − μ) ÷ σ
This is essential before training many machine learning algorithms (linear regression, SVM, neural networks) — because models with features on different scales can produce biased results where large-scaled features dominate.
Standard deviation is the denominator in this transformation. Calculating it accurately for each feature is a fundamental preprocessing step in virtually every serious ML pipeline.
In portfolio theory, the standard deviation of portfolio returns is the primary measure of total investment risk. The concept of the Sharpe Ratio divides excess return by standard deviation:
Sharpe Ratio = (Portfolio Return − Risk-Free Rate) ÷ Portfolio SD
A higher Sharpe Ratio means better risk-adjusted return. Two portfolios with identical returns but SD of 8% vs 15% have very different Sharpe Ratios — and therefore different attractiveness to risk-aware investors.
For investment planning that incorporates risk-return tradeoffs, our Compound Interest Calculator and Future Value Calculator provide complementary modelling tools.
In manufacturing and process improvement, the Six Sigma methodology defines quality targets in terms of standard deviations:
A process operating at Six Sigma quality has its mean positioned six standard deviations away from the nearest specification limit — meaning defects occur at statistically negligible rates. Achieving Six Sigma certification is a major quality milestone for manufacturers in automotive, aerospace, pharmaceuticals, and electronics.
For normally distributed data, standard deviation divides the distribution into predictable segments:
| Range | % of Data Contained |
|---|---|
| Mean ± 1 SD | ~68.27% |
| Mean ± 2 SD | ~95.45% |
| Mean ± 3 SD | ~99.73% |
Practical example: If the mean height of adult males in the UK is 175.3cm with SD = 7.0cm:
Any individual outside the mean ±3 SD range is statistically unusual — occurring in fewer than 3 in 1,000 cases.
Calculate the mean of your dataset. Subtract the mean from each value to get the deviation. Square each deviation. Average the squared deviations (divide by N for population, n−1 for sample). Take the square root. The result is the standard deviation. The calculator performs all steps instantly and shows the full working.
Population: σ = √[Σ(x−μ)²/N]. Sample: s = √[Σ(x−x̄)²/(n−1)]. Both formulas measure how spread the data is around the mean. The difference is the denominator: N for a complete population, n−1 for a sample (Bessel's correction to avoid underestimating population variance).
Use =STDEV.S(range) for sample standard deviation (most common) or =STDEV.P(range) for population standard deviation. Example: =STDEV.S(A1:A20) returns the sample SD of values in cells A1 through A20. For variance, use =VAR.S() or =VAR.P() with the same range syntax.
Population SD (σ) uses N in the denominator and is for complete datasets. Sample SD (s) uses n−1 and is for subsets of a larger population. Sample SD is larger than population SD for the same data — the smaller denominator compensates for a sample's tendency to underestimate true population variability. Use sample SD for research and business analysis; population SD only when you have complete data.
Complete your statistics and data analysis toolkit:
Statistics Tools:
Finance Tools:
Academic Tools:
Standard deviation is one of the most frequently calculated — and most frequently misunderstood — numbers in statistics. It appears in investment risk assessments, exam grade analyses, manufacturing quality reports, clinical trial results, machine learning preprocessing pipelines, and government economic data. In every context, it answers the same fundamental question: how spread out is this data?
A mean tells you the centre. Standard deviation tells you how representative that centre actually is. Together, they give you a complete picture of your data's behaviour.
This calculator puts that complete picture in your hands — for any dataset, with every step shown, for both sample and population scenarios, with grouped data support and relative SD output. No formulas to remember. No spreadsheet to build. Just your data and your answer.
Calculate it. Understand it. Bookmark it for every time your data needs more than just an average.
👉 Calculate Your Standard Deviation Now →
All standard deviation calculations use validated statistical formulas. Sample SD uses Bessel's correction (n−1 denominator) as the default. Population SD uses the N denominator. Grouped data calculations use the frequency-weighted formula with class midpoints. Results are accurate to multiple decimal places. For full descriptive statistics and data analysis, explore the related tools above.
Helpful answers related to this calculator.
Standard deviation measures how spread out values are around the mean in a dataset. A low SD means values cluster near the mean; a high SD means values are widely dispersed. It's the square root of variance, expressed in the same units as the original data, making it directly interpretable alongside mean values.
Variance is the average of the squared deviations from the mean. Standard deviation is simply the square root of variance. Variance is useful mathematically but harder to interpret because it's in squared units. Standard deviation converts it back to the original unit, making it more intuitive for practical analysis.
A standard deviation of 0 means all values in the dataset are identical — there is no variation at all. Example: dataset 5, 5, 5, 5, 5 has SD = 0. In practice, SD of 0 is rare and usually indicates either perfectly consistent data or a measurement/reporting error.
"Good" depends entirely on context. In a quality control process measuring components to millimetre tolerances, an SD of 0.5mm might be too high. In a salary dataset, an SD of $15,000 might be perfectly expected. The relative standard deviation (RSD%) allows meaningful judgment: SD < 10% of the mean generally indicates acceptable consistency in most business and scientific contexts.
RSD, also called Coefficient of Variation (CV), expresses SD as a percentage of the mean: RSD = (SD ÷ Mean) × 100. It allows comparison of variability between datasets with different units or scales. An RSD of 5% means the SD is 5% of the mean — indicating low relative variability regardless of the actual scale of measurement.
In finance, standard deviation of returns measures investment volatility — the risk that actual returns will differ from expected returns. A higher SD means greater price swings and more uncertainty. Comparing SD across investments lets you assess risk-adjusted performance — the Sharpe Ratio uses SD to standardise return comparisons across investments with different volatility profiles.
For grouped data in class intervals, SD is calculated using the formula σ = √[Σf(x−μ̄)²/Σf], where x is the midpoint of each class and f is its frequency. The calculation uses a frequency-weighted approach that estimates the spread as if you knew the approximate distribution of values within each interval.
No. Standard deviation is always zero or positive. It involves squaring deviations (making them positive) and then taking a square root (which is always non-negative). A negative standard deviation result indicates a calculation error.
Mean = (2+4+4+4+5+5+7+9) ÷ 8 = 40 ÷ 8 = 5. Sum of squared deviations = (9+1+1+1+0+0+4+16) = 32. Population variance = 32 ÷ 8 = 4. Population SD = √4 = 2. Sample SD = √(32÷7) = √4.571 = 2.138.
Increasing sample size generally makes the sample SD a more accurate estimate of the true population SD — it reduces sampling error. However, sample size does not systematically increase or decrease SD itself. What changes is the standard error of the mean (SD ÷ √n), which decreases as n increases — meaning larger samples give you a more precise estimate of the true mean.