Descriptive statistics calculator: mean, median, mode, standard deviation, variance, quartiles, IQR, outliers, skewness and kurtosis, with a histogram.
Maximum decimal places: 6; Nearest, ties away from zero
Median
24.5
Mode
22 (occurs 2 times)
Count n
18
Sum
480
Minimum
12
Maximum
64
Range
52
Sample variance s²
136.588235
Sample standard deviation s
11.687097
Population variance σ²
129
Population standard deviation σ
11.357817
Standard error of the mean
2.754675
First quartile Q1
19.5
Third quartile Q3
30.5
Interquartile range
11
Outliers
64: outside the 1.5·IQR fences 3 and 47
Skewness (G1)
1.959304
Excess kurtosis (G2)
5.600893
Coefficient of variation
43.83%
The mean is 26.6667 and the median is 24.5. The sample standard deviation is 11.6871, and the middle half spans 19.5 to 30.5. The data are right-skewed (a longer tail of high values). Values outside the 1.5·IQR fences: 64. Review their context before deciding how to use them.
Histogram (6 bins of width 10)
Box plot (whiskers at the most extreme values inside the fences)
Frequency table (a value on a bin edge counts in the higher bin) Rows: 6
Bin
Count
Relative frequency
Cumulative
10 to 20
5
27.78 %
27.78 %
20 to 30
8
44.44 %
72.22 %
30 to 40
4
22.22 %
94.44 %
40 to 50
0
0 %
94.44 %
50 to 60
0
0 %
94.44 %
60 to 70
1
5.56 %
100 %
How it's calculated S
Sum and mean
xˉ=n∑xi=18480=26.666667
Median
x~=24.5
The average of the sorted values at positions 9 and 10.
m_k = Σ(x − x̄)^k / n are the central moments. These match Excel SKEW and KURT.
About the descriptive statistics calculator
Descriptive statistics summarise a data set by its centre, spread and shape. The mean is the sum divided by n; the sample variance divides the squared deviations from the mean by n − 1 and the population variance by n. Quartiles come from the sorted data by linear interpolation (R-7, as Excel QUARTILE.INC), the exclusive method (R-6) or Tukey's hinges, and skewness and excess kurtosis use the adjusted formulas of Excel SKEW and KURT.
Values more than 1.5 × IQR beyond the quartiles are flagged as outliers, following Tukey's box-plot rule. The default data, 18 commute times in minutes, have a mean of 26.67 and a median of 24.5; the 64-minute trip lies beyond the upper fence of 47 and pulls the mean above the median.
Use the sample standard deviation when the data are a sample from a larger group, and the population value when they are the whole group.
How to calculate standard deviation by hand
Standard deviation is the square root of the average squared distance from the mean: σ = √(Σ(x − μ)² ÷ n) for a population, s = √(Σ(x − x̄)² ÷ (n − 1)) for a sample. For the quiz marks 2, 4, 4, 4, 5, 5, 7 and 9, σ = 2 and s = 2.138.
Find the mean: the marks add up to 40, and 40 ÷ 8 = 5.
Subtract the mean from each value and square the result.
Mark x
Deviation x − 5
Squared deviation
2
−3
9
4
−1
1
4
−1
1
4
−1
1
5
0
0
5
0
0
7
2
4
9
4
16
Sum
0
32
Add the squared deviations: 32. The deviations themselves always sum to 0, which checks step 2.
Divide to get the variance: 32 ÷ 8 = 4 for the population variance σ², or 32 ÷ 7 = 4.571429 for the sample variance s².
Take the square root: σ = √4 = 2 and s = √4.571429 = 2.138090.
Variance is in squared units, marks² here, which is why the square root is taken: the standard deviation, 2.14 marks, is back on the scale of the data and can be compared with the mean.
Sample or population: which to use
Divide by n when the data are the whole group you want to describe, such as every student in one class. Divide by n − 1 when they are a sample standing in for a larger group, such as eight students surveyed about a whole year group.
Deviations from a sample's own mean run slightly small, and n − 1 corrects for that. The sample result is larger by a factor of √(n ÷ (n − 1)), which matters for small data sets and fades as n grows:
Values n
Sample SD ÷ population SD
2
1.4142
3
1.2247
5
1.1180
10
1.0541
30
1.0171
100
1.0050
1,000
1.0005
Software defaults differ:
Tool
Sample (n − 1)
Population (n)
Excel
STDEV.S
STDEV.P
Python statistics module
stdev()
pstdev()
NumPy
np.std(x, ddof=1)
np.std(x), the default
pandas
DataFrame.std(), the default
DataFrame.std(ddof=0)
This calculator
Sample standard deviation s
Population standard deviation σ
NumPy's std divides by n unless told otherwise, while pandas divides by n − 1, so the same column gives two answers. Excel's STDEV.S skips text and empty cells in a range, so a number stored as text silently drops out.
Mean, median, mode and range
The mean is the sum divided by the count, 40 ÷ 8 = 5. The mode, the most frequent value, is 4, and it is the only one of these measures that also works for categories. The range, 9 − 2 = 7, depends on just two values.
The median is the middle of the sorted data, at position (n + 1) ÷ 2. Eight marks put it halfway between the 4th and 5th values, 4 and 5, so the median is 4.5. An odd count gives a single value: 9, 1, 5, 3, 7 sorts to 1, 3, 5, 7, 9, median 5.
The median ignores how far the extremes reach, so a mean above the median points to a longer tail of high values. Here the 9 pulls the mean half a mark above the median, and the sample skewness is 0.818.
Quartile methods compared
Q1 and Q3 cut off the lowest and highest quarters of the sorted data, and the interquartile range, Q3 − Q1, is the spread of the middle half. Hyndman and Fan (1996) list nine ways to place them. Three common ones disagree on the quiz marks:
Method
Q1
Q3
IQR
1.5 × IQR fences
Is the 9 an outlier?
Linear interpolation (R-7)
4
5.5
1.5
1.75 and 7.75
Yes
Exclusive (R-6)
4
6.5
2.5
0.25 and 10.25
No
Tukey's hinges
4
6
2
1 and 9
No, it sits on the fence
R-7 places Q3 at position (n − 1) × 0.75 + 1 = 6.25 in the sorted list, a quarter of the way from the sixth value (5) to the seventh (7). It is Excel's QUARTILE.INC, the default of R's quantile() and of NumPy's percentile().
R-6 uses position (n + 1) × 0.75 = 6.75 instead. It is Excel's QUARTILE.EXC and the method R's documentation attributes to Minitab and SPSS. Python's statistics.quantiles() uses it by default.
Tukey's hinges are the medians of the lower half (2, 4, 4, 4) and the upper half (5, 5, 7, 9). R's fivenum() reports these.
With only eight values, the method alone decides whether the 9 counts as an outlier. Before comparing quartiles or outlier counts with a textbook or another program, find out which method it uses.
Common mistakes
Reporting the standard error as the spread. The standard error of the mean, s ÷ √n, measures how precisely the sample mean estimates the population mean. For the quiz marks it is 2.138 ÷ √8 = 0.756, almost three times smaller than s. It is what a confidence interval for the mean is built from.
Using the coefficient of variation without a true zero. The CV, s ÷ |mean| × 100, is 42.76% for the marks and compares spread across data on different scales. It is meaningless for temperatures in °C or any measure that can be negative, because a mean near zero inflates it without limit.
Trusting the one-pass formula. The shortcut (Σx² − (Σx)² ÷ n) ÷ (n − 1) loses precision when values are large and close together. On NIST's NumAcc3 data set, 1,001 values near 1,000,000.2 with a certified standard deviation of 0.1, the shortcut in Python floats returns 0.1072. Subtracting the mean first, as in step 2, gives 0.1 to ten digits even in floats.
Measuring spread with one value. A single value has nothing to vary from, and the sample formula would divide by zero, so at least two values are needed.
Once the mean and standard deviation are known, the normal distribution calculator turns any value into a z-score and percentile, provided the data look roughly bell-shaped.
Checked against: NIST StRD NumAcc3 certified values: mean 1000000.2, standard deviation 0.1; confirmed exactly with exact fractions (G2 = −667/333)
Exclusive quartiles (R-6)
Data
7, 15, 36, 39, 40, 41
Quartile method
Exclusive (R-6, Excel QUARTILE.EXC, Minitab)
First quartile Q1
13
Third quartile Q3
40.25
Median
37.5
Interquartile range
27.25
Checked against: Independent calculation
Questions
What is the difference between sample and population standard deviation?
The sample standard deviation divides the sum of squared deviations by n − 1 (Bessel's correction), the population one by n. Deviations measured from the sample mean run slightly small, and n − 1 compensates when estimating a larger population's spread. For the 18 default values s = 11.687 and σ = 11.358, and the gap shrinks as n grows. Excel's STDEV.S and STDEV.P follow the same split.
How are outliers identified?
By Tukey's rule: a value is an outlier if it lies below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. For the default data Q1 = 19.5 and Q3 = 30.5, so the IQR is 11, the fences are 3 and 47, and the 64 is flagged. Values beyond 3 × IQR are often called extreme outliers. A flagged value is a prompt to check the data, not a reason to delete it.
Why do quartiles differ between Excel, calculators and textbooks?
Hyndman and Fan (1996) list nine published definitions. Excel QUARTILE.INC and R's default interpolate at position (n − 1)p + 1, QUARTILE.EXC and Minitab use (n + 1)p, and many textbooks use Tukey's hinges, the medians of each half. For 7, 15, 36, 39, 40, 41 these give Q1 and Q3 of 20.25 and 39.75, 13 and 40.25, and 15 and 40.
What do skewness and kurtosis values mean?
Skewness measures asymmetry: 0 for symmetric data, positive when the long tail is on the high side. Bulmer's (1979) rule of thumb reads |G1| below 0.5 as roughly symmetric, 0.5 to 1 as moderately skewed and above 1 as highly skewed. Excess kurtosis compares tail weight with a normal distribution, which scores 0. The default data give G1 = 1.96 and G2 = 5.60, both driven by the 64-minute trip.
When should I use the median instead of the mean?
When the data are skewed or contain outliers, because one extreme value moves the mean but not the median. In the default data the 64-minute trip lifts the mean to 26.67 while the median is 24.5; without that trip the mean would be 24.47 and the median 24. Incomes and house prices are usually reported as medians for the same reason.
This calculator includes 7 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.
Put this calculator on your site
Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.