Mathematics · Statistics

Descriptive statistics calculator — mean, spread and quartiles

Calculate mean, median, variance, standard deviation and quartiles with explicit population or sample mode.

Created v1.0

By Thibaut Grzelak, Mechanical Analysis Engineer

Statistics
01

Calculation inputs

Use spaces, semicolons or newlines between values. A point or comma is a decimal separator, never a list separator. Scientific notation is accepted.

03

Results

Count n
5
Sum
15
Median
3
Minimum
1
Maximum
5
Range
4
Variance
2
First quartile Q1
2
Third quartile Q3
4

Results show up to four significant digits for readability; internal calculations retain full precision.

See calculation details

01Count n

Formulan = # {xᵢ}
Result
5

02Sum

Formula∑ᵢ xᵢ
Substitution1 + 2 + 3 + 4 + 5
Result
15

03d̄

Formuladᵢ = xᵢ − x₀ ; d̄ = (∑ᵢ dᵢ)/n
Substitution10 / 5
Result
2

04Mean

Formulax̄ = x₀ + d̄
Substitution1 + 2
Result
3

05S₂

FormulaS₂ = ∑ᵢ(dᵢ − d̄)²
Substitution(-2)² + (-1)² + 0² + 1² + 2²
Result
10

06Variance

Formulaσ² = S₂/n
Substitution10 / 5
Result
2

07Standard deviation

Formulaσ = √σ²
Substitution√(2)
Result
1.414

08x₀ ≤ … ≤ xₙ₋₁

Formulax₀ ≤ x₁ ≤ … ≤ xₙ₋₁
Result
(1 ; 2 ; 3 ; 4 ; 5)

09First quartile Q1

Formulah = (n − 1)p ; h = j ⇒ Q(p) = xⱼ
Substitutionh = (5 − 1) × 0.25 = 1; j = 1; Q = 2
Result
2

10Median

Formulah = (n − 1)p ; h = j ⇒ Q(p) = xⱼ
Substitutionh = (5 − 1) × 0.5 = 2; j = 2; Q = 3
Result
3

11Third quartile Q3

Formulah = (n − 1)p ; h = j ⇒ Q(p) = xⱼ
Substitutionh = (5 − 1) × 0.75 = 3; j = 3; Q = 4
Result
4

12Minimum

Formulamin = x₀
Substitution1
Result
1

13Maximum

Formulamax = xₙ₋₁
Substitution5
Result
5

14Range

Formulamax − min
Substitution5 − 1
Result
4
01Formulas and symbols

Formulas used

x̄

x̄ = (∑ xᵢ)/n

σ² = (∑(xᵢ−x̄)²)/n

s² = (∑(xᵢ−x̄)²)/(n−1)

x̄: mean; n: count; σ²: population variance; s²: sample variance.

Q

h = (n−1)p

j = ⌊h⌋

Q(p) = xⱼ + (h−j)(xⱼ₊₁−xⱼ)

Q(p): R7 quantile at proportion p; j: zero-based integer index in the sorted data.

SymbolMeaning
xᵢData values
nCount n
∑xᵢSum
x̄Mean
Q₂Median
minMinimum
maxMaximum
max−minRange
σ² / s²Variance
σ / sStandard deviation
Q₁First quartile Q1
Q₃Third quartile Q3
02Validation example

Reference numerical case

  1. [1, 2, 3, 4, 5]: mean 3, median 3, range 4, population variance 2 and standard deviation √2; sample variance 2.5. R7 gives Q1 = 2 and Q3 = 4; for [1, 2, 3, 4], Q1 = 1.75 and Q3 = 3.25.
03How it works

The population variance divides the squared deviations by n; sample variance divides by n−1. Q1, median and Q3 use R7 linear interpolation at sorted zero-based index (n−1)p, with p = 0.25, 0.5 and 0.75.

In the sorted list with zero-based indices, h locates the requested percentile between two neighboring values; the fractional part h−j supplies the interpolation weight. At the last value, use that value directly.

04Limits and conventions

One to 5000 finite unweighted values; sample mode requires at least two. Different quartile conventions can give different answers. Up to 20 observations are shown as dots; larger series use a histogram with at most 20 bins; exact summary statistics are calculated from every value.

05Common mistakes

Variance has squared data units, while standard deviation has the original units. Choose sample mode when estimating variance from a sample rather than describing the entire population.

06Practical questions

What is the difference between population and sample standard deviation?

Population standard deviation divides the squared deviations by n because the complete population is described. Sample standard deviation uses n−1 to estimate population variability from a sample.

Why can mean and median be very different?

The mean uses every value and can be pulled strongly by extreme observations. The median depends on the middle position after sorting, so it is usually less sensitive to outliers and skewed data.

07Technical references