Standard deviation calculator
Paste your data separated by commas, spaces or line breaks. The calculator shows all key descriptive statistics together with the steps.
How it is calculated
How the calculator works
For a data set of n values x1, …, xn the calculator uses the definitions of the NIST/SEMATECH e-Handbook of Statistical Methods:
- Mean: x̄ = (x1 + … + xn) / n
- Median: the middle value of the sorted list; with an even count, the average of the two middle values.
- Mode: the most frequent value. There can be several modes; if every value occurs equally often, there is no mode.
- Range: maximum − minimum.
- Sample variance: s² = Σ(x − x̄)² / (n − 1), standard deviation s = √s².
- Population variance: σ² = Σ(x − x̄)² / n, σ = √σ².
Sample or population?
If your numbers are the whole group you care about (e.g. the scores of every student in one class), divide by n. If they are a sample used to draw conclusions about a larger group (e.g. 50 surveyed customers), divide by n − 1 (Bessel's correction). In Excel these are STDEV.S and STDEV.P.
Worked example
Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8). Sum 40, mean 40 / 8 = 5. Sorted, the two middle values are 4 and 5, so the median is 4.5. The mode is 4 (three times). Squared deviations: 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32. Population: σ² = 32 / 8 = 4, σ = 2. Sample: s² = 32 / 7 ≈ 4.5714, s ≈ 2.1381. Range 9 − 2 = 7.
Quartiles
Q1 and Q3 use linear interpolation (Excel QUARTILE.INC, the R default). Textbooks and the TI-84 sometimes use other methods, so quartiles can differ slightly.
The calculation is numerically stable (corrected two-pass algorithm) and reproduces NIST's certified reference data sets, even for large numbers with a small spread.
Frequently asked questions
Should I use the sample or the population standard deviation?
Use the population formula (divide by n) when your data contain every member of the group. Use the sample formula (divide by n − 1) when the data are a sample and you want to estimate the spread of a larger population – the usual case for measurements and surveys.
What is the difference between variance and standard deviation?
The standard deviation is the square root of the variance. It has the same unit as the data (e.g. cm), whereas the variance is in squared units (cm²), which makes the standard deviation easier to interpret.
What does "no mode" mean?
If every value occurs equally often (for example each exactly once), no value stands out, so there is no mode. If several values share the highest frequency, all of them are shown (bimodal or multimodal data).
Mean or median – which is better?
The median is robust against outliers: for 1, 2, 3, 4, 100 the mean is 22 but the median is 3. For skewed data such as incomes or house prices, the median describes the centre better.
How do I enter decimals and large numbers?
Use a dot for decimals (2.5). Because commas separate values here, write thousands without separators (1500, not 1,500).
Why are my quartiles different from my textbook or TI-84?
There are several common definitions of quartiles. This calculator uses linear interpolation like Excel QUARTILE.INC. Mean, median, variance and standard deviation are uniquely defined and will match.
Sources and legal basis
- Section 1.3.5.1: NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Location (mean, median, mode)
- Section 1.3.5.6: NIST/SEMATECH e-Handbook of Statistical Methods – Measures of Scale (variance, standard deviation, range)
- Section 7.2.6.2: NIST/SEMATECH e-Handbook – Percentiles and quartiles
- NIST Statistical Reference Datasets – certified values for mean and standard deviation
As of:
Related tools
- GPA & Weighted Grade CalculatorCalculate your GPA or weighted grade average: enter letter grades or numbers with credits or weights and get the result with every step shown.
- Percentage CalculatorFree percentage calculator: find X% of a number, what percent one number is of another, percentage change, increase and discount – with formula and steps.
- Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers with step-by-step solutions. Simplify fractions and convert decimals to fractions.
- Exponent calculator with stepsCalculate powers, nth roots and logarithms with any base – step-by-step, with negative and fractional exponents, ln, log and scientific notation.
- Age CalculatorCalculate your exact age from your date of birth in years, months and days, in total days, weeks and months – plus the countdown to your next birthday.
- Date CalculatorCount the days between two dates, add or subtract days, weeks, months or years, and add business days with public holidays for your country.