Statistics Calculator
Mean, median, mode, standard deviation and more for a list of numbers.
Separate the numbers with commas, spaces, semicolons or new lines. Decimals need a point: 1,5 is read as the two numbers 1 and 5.
- Mean
- 5
- sum ÷ count
- Median
- 4.5
- halfway between the two middle values
- Mode
- 4
- appears 3 times
- Count
- 8
- Sum
- 40
- Minimum
- 2
- Maximum
- 9
- Range
- 7
- Lower quartile (Q1)
- 4
- Upper quartile (Q3)
- 6
- Interquartile range
- 2
Variance and standard deviation
| Population (÷ n) | Sample (÷ n − 1) | |
|---|---|---|
| Variance | 4 | 4.571428571 |
| Standard deviation | 2 | 2.138089935 |
Box plot
Sorted, smallest first
2, 4, 4, 4, 5, 5, 7, 9
Reading the results
Mean, median and mode
The mean is the sum divided by the count. The median is the middle value of the sorted list, or halfway between the two middle values when the count is even. On evenly spread data the two are close. A single extreme value pulls them apart.
Take six salaries at a small firm: 28,000, 31,000, 33,000, 35,000, 38,000 and the owner's 250,000. The mean is 69,167, which is more than five of the six people earn. The median is 34,000 and says far more about a typical employee. This is why incomes and house prices are usually reported as medians.
The mode is the value that occurs most often. A list can have several modes, and when every value occurs once it has none.
Population or sample?
The variance is the average squared distance to the mean. The standard deviation is its square root, which brings it back to the unit of the data. Both come in two versions, and the calculator shows them side by side.
- Population (σ, dividing by n): the list is the whole group you want to describe, such as the test scores of everyone in a class.
- Sample (s, dividing by n − 1): the list is part of a larger group and you want to estimate the spread of that larger group, such as thirty parts measured out of a production run.
Values in a sample lie closer to their own mean than to the true mean of the whole group, so dividing by n would underestimate the spread. Dividing by n − 1 instead, known as Bessel's correction, removes that bias from the variance. With a handful of values the two versions differ a lot, with hundreds they barely do.
For 2, 4, 4, 4, 5, 5, 7, 9 the mean is 5 and the squared distances are 9, 1, 1, 1, 0, 0, 4 and 16, which add up to 32. As a population that gives a variance of 32 ÷ 8 = 4 and a standard deviation of 2. As a sample it gives 32 ÷ 7 ≈ 4.571 and a standard deviation of about 2.138.
In Excel and Google Sheets, STDEV.S is the sample version and STDEV.P the population version.
How the quartiles are found
There are several accepted ways to calculate quartiles and they do not always agree. This calculator uses the one taught in most schools and built into the TI-83 and TI-84: split the sorted list in half at the median and take the median of each half. When the count is odd, the middle value belongs to neither half.
For 1, 2, 3, 4, 5 the halves are 1, 2 and 4, 5, so Q1 is 1.5 and Q3 is 4.5. Excel's QUARTILE.INC interpolates between the values instead and returns 2 and 4 for the same list. Neither is wrong, but say which method you used when your figures are compared with someone else's.
The interquartile range is Q3 − Q1, the width of the middle half of the data. The box plot draws it as a box from Q1 to Q3 with a line at the median. Its whiskers run to the smallest and the largest value; outliers are not marked separately.
Precision
Results are rounded to 10 significant digits for display, and whole numbers are shown in full. The sorted list keeps every value exactly as it was read, so you can copy it back into the box.