Statistics Calculator
Get the mean, median, mode, quartiles and standard deviation of a data set, with the working.
Separate them with commas, spaces or new lines.
See it happen: Normal and binomial distributions
Formulas
- Mean x̄ = Σx / n
- Population standard deviation σ = √(Σ(x − x̄)² / n)
- Sample standard deviation s = √(Σ(x − x̄)² / (n − 1))
- Interquartile range IQR = Q3 − Q1. Outliers lie more than 1.5 × IQR beyond the quartiles.
Worked example
Find the mean, median, mode and standard deviation of 2, 4, 4, 4, 5, 5, 7, 9.
- n = 8 and Σx = 40, so the mean is 40 / 8 = 5.
- The data are already in order. The middle two values are 4 and 5, so the median is 4.5.
- 4 appears three times, so the mode is 4.
- The squared differences from the mean are 9, 1, 1, 1, 0, 0, 4 and 16, which add up to 32.
- Population SD = √(32 / 8) = 2. Sample SD = √(32 / 7) ≈ 2.14.
Answer: Mean 5, median 4.5, mode 4, standard deviation 2 (population) or 2.14 (sample).
Common mistakes
- Finding the median before putting the data in order.
- Using the population formula for a sample, or the other way round: check which one the question means.
- Taking the median as the value at position n / 2: it sits at position (n + 1) / 2.
- Forgetting that one outlier can pull the mean a long way while the median barely moves.
About this tool
Paste a list of numbers and this statistics calculator works out the count, sum, mean, median, mode, range, minimum, maximum, lower and upper quartiles and the interquartile range, plus the population and sample standard deviation and variance. It draws a box plot with any outliers marked (values more than 1.5 × IQR beyond the quartiles) and a dot plot of every value, and it shows the working for the mean, the median and the standard deviation step by step.
Tips
- The median is in position (n + 1) / 2 once the values are in order. With an even count, it is halfway between the two middle values.
- An outlier pulls the mean towards it but hardly moves the median, so the median is the better average for skewed data.
- Different textbooks find quartiles in slightly different ways. If your answer is out by a little, switch the quartile method.
FAQ
- What is the difference between population and sample standard deviation?
- Both measure how spread out the data is. The population SD divides by n. The sample SD divides by n − 1, which makes it slightly larger and gives a better estimate of the spread of the whole population from a sample.
- How are the quartiles worked out?
- The values are put in order and split into a lower and an upper half. Q1 is the median of the lower half and Q3 the median of the upper half. With an odd count you can include the median in both halves or leave it out of both; the calculator lets you choose.
- How does it decide what an outlier is?
- Any value below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR counts as an outlier. It is shown as a separate dot on the box plot, and the whiskers stop at the furthest values that are not outliers.