Mean and standard deviation calculator

Paste numbers for mean, median, mode, standard deviation, quartiles and outliers.

Dividing by n gives the population figure and n−1 the sample figure. If what you hold is part of something larger, n−1 is right — and this is the commonest reason two calculators disagree, so both are shown. Numbers can be pasted separated by commas, newlines or spaces.

Data

Paste separated by commas, newlines or spaces.

Centre

Mean

5

Centre

Median
4.5
Mode
4
Count
8
Sum
40

Spread

Sample SD (n−1)
2.1381
Sample variance
4.5714
Population SD (n)
2
Population variance
4

Range and quartiles

Minimum
2
Maximum
9
Range
7
Q1
4
Q3
5.5
IQR
1.5
Outliers
9

Population (n) when you hold everything; sample (n−1) when you hold part of it. Most real data is a sample.

Quartiles use linear interpolation (Excel's QUARTILE.INC). Outliers are values beyond 1.5 IQR — a convention, not a verdict on the data.

Working through the eight default numbers

2, 4, 4, 4, 5, 5, 7, 9 sum to 40, so the mean is 5. The squared differences from the mean add up to 32; dividing by 8 gives the population variance 4, and by 7 the sample variance 4.5714. Standard deviation is the square root, so 2 and 2.1381. The median is the average of the middle two after sorting, 4.5, and the mode is 4, which appears three times. Values are shown to four decimal places.

Quartiles allow fractional positions

Linear interpolation looks at position (n−1)×p in the sorted list. With eight values, Q1 is position 1.75, between the second and third values, both 4, so 4. Q3 is position 5.25, a quarter of the way from the sixth value 5 to the seventh 7, so 5.5. The IQR is 1.5, and 9 exceeds Q3 + 2.25 = 7.75, so it is flagged as an outlier. With a single value there is nothing to divide by, so the sample variance is set to 0.

The mode can be several values, or none

If two or more values tie for most frequent, all of them are listed in ascending order. If every value appears once, the screen says there is no mode — calling all of them modes would misread the data. Anything that is not a number is silently dropped and not counted, so if the count differs from the number of lines you pasted, something was not read.

What this screen does not do

No weighted mean, geometric mean, skewness or kurtosis. Two columns are not read as pairs, so there is no correlation. A number with a thousands separator such as 1,000 splits into 1 and 0 and becomes two values, so remove the commas first. Pasted data is not saved; reopening the page restores the default.

Common questions

QSample or population?

Population (n) when you hold everything you are describing; sample (n−1) when you hold a subset and are estimating the whole. The heights of all 30 students in a class is a population; 30 drawn to estimate the school is a sample. Most real data is a sample.

QThe quartiles differ from Excel.

Quartiles have several definitions. This uses linear interpolation (Excel's QUARTILE.INC, R's type 7), which matches Excel's default. QUARTILE.EXC gives different values.

QHow are outliers decided?

Anything more than 1.5 interquartile ranges outside the quartiles — below Q1 − 1.5×IQR or above Q3 + 1.5×IQR. It is Tukey's convention, not an absolute rule, and being an outlier does not make a value wrong.

QWhy is the standard deviation 0 with a single value?

The population standard deviation is 0 because the one value equals the mean, and the sample version cannot divide by n−1 = 0, so it is set to 0. Spread needs at least two values.

QCan the mean be a value that is not in the data?

Yes. The mean of 1, 2, 3, 4, 100 is 22, which appears nowhere, while the median 3 better describes the middle. 100 exceeds Q3 + 1.5×IQR = 7 and is flagged as an outlier — it is what pulled the mean up.

Source last checked: 2026-08-22

This tool does not replace tax or investment advice; the result is for reference.