Skip to content
Back to Calculators

Statistics Calculator for Data Sets

Mean, median, mode, range, quartiles, standard deviation and geometric mean for any list of numbers

Paste or type values separated by commas, spaces, tabs or new lines. Use a dot for decimals; scientific notation such as 1.5e3 works. Up to 10,000 values.

Calculated in your browser. Nothing you enter is saved or sent.

Illustrative example shown: 1, 2, 2, 4, 9. Enter your own numbers and press Calculate.

Mean
3.6
sum 18 ÷ 5
Median
2
middle of the sorted data
Mode
2
appears 2 times

All measures

Count
5
Sum
18
Minimum / maximum
1 / 9
Range
8
Q1 / Q3
1.5 / 6.5
Interquartile range
5
Sample SD (s)
3.209361307
Population SD (σ)
2.870540019
Sample variance
10.3
Population variance
8.24
Geometric mean
2.701920077

Want the full working for the standard deviation? Open the standard deviation calculator.

Shape of the data

19mean
Top: histogram of the values. Bottom: box from Q1 to Q3 with the median line, whiskers to the minimum and maximum, orange triangle at the mean.

Sorted data

1, 2, 2, 4, 9

Frequency table

How many times each value appears
ValueCountShare
1120%
2240%
4120%
9120%

The steps

  1. Mean: add the 5 values (sum 18) and divide by 5: 3.6.
  2. Median: sort the data, then take the middle value: 2.
  3. Mode: 2 appears 2 times, more than any other value.
  4. Range: largest minus smallest = 9 − 1 = 8.
  5. Quartiles: Q1 is the median of the lower half (1.5) and Q3 the median of the upper half (6.5); the middle value is left out of both halves when n is odd. IQR = 6.5 − 1.5 = 5.
  6. Geometric mean: the 5th root of the product, calculated through logarithms: 2.701920077.

What to enter and what you get

Type or paste your numbers separated by commas, spaces, tabs or new lines. Decimals, negatives and scientific notation such as 1.5e3 are read correctly, and up to 10,000 values are accepted. Thousands separators are not, because "1,200" would be read as two numbers, 1 and 200. If a value cannot be read, the error names its position so you can fix it.

The calculator returns the count, sum, mean, median, mode, minimum, maximum, range, the first and third quartiles, the interquartile range, sample and population standard deviation and variance, and the geometric mean. A box plot and histogram show the shape of the data at a glance. The sample mean and the population mean are the same arithmetic operation, adding the values and dividing by the count, so there is only one mean here; the two forms of standard deviation differ in the denominator.

Worked example: centre and range

Take 1, 2, 2, 4, 9. The sum is 18 and there are 5 values, so the mean is 18 ÷ 5 = 3.6. The data are already in order and the middle value is the third, so the median is 2. The value 2 appears 2 times and every other value once, so the mode is 2. The range is the largest minus the smallest: 9 − 1 = 8.

Notice that the mean (3.6) is pulled well above the median (2) by the single large value 9. That gap is a quick sign of a skewed data set: when the mean and median disagree a lot, the median usually describes a typical value better. A data set can also have two modes. For 1, 1, 2, 2, 3 both 1 and 2 appear 2 times, so both are reported. If every value is different, as in 3, 6, 9, there is no mode at all, and the calculator says so instead of inventing one. The sample standard deviation of the first set is 3.20936.

Quartiles, the IQR and outliers

Quartiles split sorted data into four parts. The median is the second quartile, Q2. Q1 is the median of the lower half and Q3 the median of the upper half. When the count is odd, the middle value is left out of both halves. For 1, 2, 2, 4, 9, the lower half is 1, 2 and the upper half is 4, 9, so Q1 = 1.5, Q3 = 6.5, and the interquartile range is Q3 − Q1 = 5.

The IQR is a spread measure that ignores the extremes. A common rule flags values more than 1.5 × IQR beyond the quartiles. For 3, 5, 7, 8, 12, 13, 14, 18, 21, 40 we get Q1 = 7, Q3 = 18 and IQR = 11, so the upper fence is 18 + 1.5 × 11 = 34.5. The value 40 lies beyond it. Without it the mean drops from 14.1 to 11.2222. Different textbooks and software use slightly different quartile methods, so your answer may differ by a little elsewhere; this page states its method, medians of the halves.

Geometric mean

The geometric mean multiplies the values and takes the n-th root, so it suits quantities that grow by multiplication, such as growth factors and ratios. For 1, 4, 16 the product is 64 and the cube root is 4, while the ordinary mean is 7. The geometric mean is always at most the arithmetic mean.

It is defined only for positive numbers. If any value is zero or negative the calculator shows that it is not defined rather than giving a misleading figure. Internally it works through logarithms, which avoids overflow with long lists of large values.

Spread and comparing data sets

The mean and median tell you where the data are centred; the range, IQR and standard deviation tell you how spread out they are. Two sets can share a mean and look nothing alike. The ten values above have a sample standard deviation of 10.7129, inflated by the outlier, while the IQR of 11 is much less affected. When you compare groups, look at a centre and a spread together. For the full working of the standard deviation, including intervals for the mean, use the <Link to="/calculators/standard-deviation">standard deviation calculator</Link>.

Frequently asked questions

What if two values tie for the mode?

Both are shown. A data set can have several modes, all reported together.

What if all the values are different?

There is no mode, under the convention that a mode must appear more than once.

Why do quartiles differ between tools?

Several valid algorithms exist, some interpolating and some excluding or including the middle value. This calculator uses the medians of the lower and upper halves, excluding the middle for odd counts.

Can the geometric mean use negative numbers?

Not here. It is not reported for zero or negative input, since the product could be negative or zero.

Is the sample mean different from the population mean?

The arithmetic is identical; only the interpretation differs.

If you only need an average, or want to see how one value changes it, use the average calculator. For chance, see the probability calculator, or browse all calculators.

Get New Free Calculators by Email

Get practical calculator walkthroughs and new tool updates by email. Occasional emails only, unsubscribe at any time.

No spam. See our privacy policy.