Statistics Calculator: Mean, Median, Mode, Std Dev & Variance

This statistics calculator takes a list of numbers and returns the count, mean, median, sum of squared deviations, and both the population and sample standard deviation. Paste or type your values and read the summary.

Math Calculators

Statistics Calculator

Mean, median, variance, standard deviation, and sum of squared deviations for a list of numbers.

Starting values: the calculator opens with the list 2, 4, 4, 4, 5, 5, 7, 9. It reports n = 8, mean = 5, median = 4.5, sum of squared deviations = 32, population standard deviation = 2 and sample standard deviation = 2.138.

What the calculator returns

The summary has six figures: the count of values (n), the mean, the median, the sum of squared deviations (SSD), the population standard deviation and the sample standard deviation. It does not report the mode, and it does not print the variance as a separate line. Variance is simply the square of the matching standard deviation, so you can get it from the output: the population variance of the default list is 2² = 4.

The formulas

Mean = (sum of all values) ÷ n
SSD = Σ(x − mean)²
Population standard deviation (σ) = √(SSD ÷ n)
Sample standard deviation (s) = √(SSD ÷ (n − 1))

Where:

  • x = each value in the list
  • n = how many values there are
  • SSD = the sum of squared deviations from the mean

The median is the middle value once the list is sorted. With an even count it is the average of the two middle values.

Population or sample: which standard deviation do I use?

The only difference between the two is the divisor. Use the population figure (divide by n) when your list is the whole group you care about, such as every score in a small class. Use the sample figure (divide by n − 1) when your list is a sample drawn from a larger group and you want to estimate the spread of that group.

Dividing by n − 1 is known as Bessel’s correction. An explanation from a maths-help site notes that dividing by n gives a variance estimate that is biased on the low side for a sample, and n − 1 corrects that. It adds that the corrected standard deviation is still very slightly biased, which is why you will see small-sample caveats in textbooks. For large lists the two figures converge.

Worked examples

Example 1: the default list

Values: 2, 4, 4, 4, 5, 5, 7, 9.

  1. Sum = 40, n = 8, so mean = 5.
  2. Deviations from 5: −3, −1, −1, −1, 0, 0, 2, 4.
  3. Squared: 9, 1, 1, 1, 0, 0, 4, 16. SSD = 32.
  4. Population SD = √(32 ÷ 8) = √4 = 2.
  5. Sample SD = √(32 ÷ 7) = √4.571 = 2.138.
  6. Sorted list: 2, 4, 4, 4, 5, 5, 7, 9. The middle two values are 4 and 5, so the median = 4.5.

Example 2: a small list

Values: 10, 12, 14. Mean = 12. Deviations: −2, 0, 2. SSD = 4 + 0 + 4 = 8. Population SD = √(8 ÷ 3) = 1.633. Sample SD = √(8 ÷ 2) = 2. The median is 12.

With only three values the gap between 1.633 and 2 is large. That gap is the effect of the n − 1 correction, and it shrinks as n grows.

Example 3: an outlier

Take 10, 12, 14 and add 100. The mean jumps to 34, while the median is 13. The standard deviation also jumps, because the single large value dominates the squared deviations. When the mean and median are far apart, the data is skewed or has an outlier, and the median is the safer measure of the typical value.

Reading the output

  • Mean and median close together: the list is roughly balanced.
  • A small standard deviation: values cluster near the mean. A large one: they are spread out.
  • SSD is the raw material for variance and standard deviation. It is also what regression and analysis-of-variance methods build on.

The standard deviation is in the same units as your data, which is why it is more convenient than the variance. If your list is in kilograms, so is the standard deviation. To see how far one value sits from the mean in standard deviations, use the z-score calculator.

Tips for entering data

  • Separate values with commas or spaces, and check for stray characters.
  • Sample standard deviation needs at least two values, since it divides by n − 1.
  • Do not mix units in one list. Convert first.
  • Enter the raw values rather than percentages of different totals.

A shortcut for the sum of squared deviations

Subtracting the mean from every value is tedious on a long list. An equivalent form needs only the sum of the values and the sum of their squares: SSD = Σx² − (Σx)² ÷ n. For the default list, Σx = 40 and Σx² = 4 + 16 + 16 + 16 + 25 + 25 + 49 + 81 = 232. Then SSD = 232 − 1,600 ÷ 8 = 232 − 200 = 32, the same figure the calculator shows.

What happens when you change every value

Adding the same amount to every value moves the mean and median by that amount but leaves the standard deviation unchanged, because the distances between values stay the same. Add 10 to the default list and the mean becomes 15 while the standard deviation stays 2. Multiplying every value by a constant scales the standard deviation by that constant: double the list and the standard deviation doubles to 4. Knowing this lets you convert units without recalculating, for example from centimetres to metres.

Frequently asked questions

Does the calculator give the variance or the mode?

Not as separate figures. Variance is the square of the standard deviation, so square the population or sample value that matches your data. The mode is not reported.

When should I use the sample standard deviation?

Use it when your numbers are a sample from a larger group and you want to estimate that group’s spread. It divides by n − 1. Use the population figure when your list is the entire group.

What is the sum of squared deviations?

It is the total of each value’s squared distance from the mean. For the default list it is 32. Divide it by n for the population variance or by n − 1 for the sample variance.

Why are the mean and median different?

The mean is pulled toward unusually large or small values, while the median ignores how extreme they are. A large gap between them suggests skew or an outlier.

Mark Danny

Mark Danny

Mark Danny builds and maintains the free calculators and guides on Area of Irregular Shapes Calculator. Every calculator page explains its formula and shows a worked example, so you can check the working yourself. Spotted a mistake or have a suggestion? Email gulsher.hingoro101@gmail.com.

Articles: 579