# Standard Deviation Calculator

URL: https://hifreetools.com/calculators/standard-deviation-calculator

> Paste or type a list of numbers and instantly get the count, sum, mean, variance, and standard deviation. This calculator returns both the population standard deviation (σ, divided by n) and the sample standard deviation (s, divided by n−1) so you always have the right one for your situation.

## Quick answer

Standard deviation measures how spread out a set of numbers is around their mean. To compute it: find the mean, subtract it from each value and square the result, average those squared differences (divide by n for a population, or by n−1 for a sample) to get the variance, then take the square root. Example: for 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared deviations sum to 32. Dividing by n=8 gives a population variance of 4, so the population standard deviation is √4 = 2. Dividing by n−1=7 gives a sample variance of ≈4.571, so the sample standard deviation is ≈2.138.

## Formula

- Population standard deviation (σ): sigma = sqrt( sum( (x_i - mu)^2 ) / N )
- Sample standard deviation (s): s = sqrt( sum( (x_i - xbar)^2 ) / (n - 1) )

The calculator first parses your input into a list of numbers, ignoring blank lines and accepting values separated by commas, spaces, or new lines. It counts the values (n), adds them to get the sum, and divides the sum by n to get the mean. For every value it subtracts the mean and squares the result; adding those squared deviations gives the "sum of squares." It then produces two answers from that single sum of squares: dividing by n yields the population variance and its square root is the population standard deviation (σ), while dividing by n−1 yields the sample variance and its square root is the sample standard deviation (s). Min, max, and range (max − min) are reported alongside so you can see the full spread at a glance. Because the only difference between the two results is the divisor, the calculator shows both every time and lets you pick the one that matches your data.

## Examples

- Textbook data set (both versions): 2, 4, 4, 4, 5, 5, 7, 9 → Mean = 5, population SD = 2, sample SD ≈ 2.138
- Evenly spaced values: 2, 4, 6, 8, 10 → Mean = 6, population SD ≈ 2.828, sample SD ≈ 3.162
- Test scores with repeats: 10, 12, 23, 23, 16, 23, 21, 16 → Mean = 18, population SD ≈ 4.899, sample SD ≈ 5.237

## FAQ

**What is the difference between population and sample standard deviation?**
Both measure spread, but they use a different divisor. Population standard deviation (σ) divides the sum of squared deviations by N and is used when your data covers the entire group you care about. Sample standard deviation (s) divides by n−1 instead of n, which corrects for the fact that a sample tends to underestimate the true spread; use it when your data is a sample drawn to estimate a larger population.

**Why does the sample formula divide by n−1 instead of n?**
This is called Bessel's correction. A sample's mean is itself estimated from the sample, which makes the squared deviations slightly too small on average. Dividing by n−1 (the degrees of freedom) compensates, giving an unbiased estimate of the population variance. That is why the sample standard deviation is always a little larger than the population value for the same numbers.

**Should I use population or sample standard deviation?**
If your data is the complete set you want to describe (for example, the test scores of every student in one class, treated as the whole population), use the population version. If your data is a sample used to draw conclusions about a bigger group you did not fully measure, use the sample version. When in doubt in research and statistics, the sample standard deviation (÷n−1) is the more common default.

**What is variance, and how does it relate to standard deviation?**
Variance is the average of the squared deviations from the mean. Standard deviation is simply the square root of the variance. Variance is expressed in squared units (for example, dollars squared), while standard deviation is in the original units (dollars), which makes it easier to interpret.

**Can the standard deviation be zero or negative?**
It can be zero, but never negative. A standard deviation of zero means every value in the data set is identical, so there is no spread. Because it is defined as the square root of an average of squared numbers, the result is always zero or positive.

**How do I enter my numbers?**
Type or paste your values separated by commas, spaces, or new lines — for example '2, 4, 4, 4, 5, 5, 7, 9' or one number per line. Blank lines are ignored. The calculator instantly reports the count, sum, mean, variance, range, and both standard deviations.


## Sources

- [NIST/SEMATECH e-Handbook of Statistical Methods — Measures of Scale (Standard Deviation)](https://www.itl.nist.gov/div898/handbook/eda/section3/eda356.htm)
- [Khan Academy — Population and sample standard deviation review](https://www.khanacademy.org/math/statistics-probability/summarizing-quantitative-data/variance-standard-deviation-population/a/population-and-sample-standard-deviation-review)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Standard Deviation Calculator", https://hifreetools.com/calculators/standard-deviation-calculator
