Math · Live
Mean Calculator —
arithmetic, geometric & harmonic.
Paste any dataset to instantly compute the arithmetic, geometric, and harmonic means alongside median, mode, range, and sum. Visualises the AM ≥ GM ≥ HM inequality on a number line and overlays all three means on a distribution chart.
Dataset
Enter your values
Examples
- Count (n)
- 6
- Sum
- 108
- Min
- 4
- Max
- 42
- Range
- 38
Arithmetic mean
AM= Σxᵢ / 6
Geometric mean
GM= (∏xᵢ)^(1/6)
Harmonic mean
HM= 6 / Σ(1/xᵢ)
Inequality
HM ≤ GM ≤ AMFor positive values, AM ≥ GM ≥ HM always holds, with equality only when all values are identical.
Statistics
Full summary
Count (n)
6
Sum
108
Median
15.5
Range
38
Min
4
Max
42
Mode
None
Unique vals
6
Distribution
Values with mean lines
Mean guide
Arithmetic, geometric, and harmonic means, when to use each.
The word "average" hides three distinct mathematical operations, each optimal for a different type of data. Choosing the wrong mean can produce misleading or meaningless results; the arithmetic mean of two growth rates overstates the actual return; the geometric mean of a set of speeds doesn't give the correct average speed. Understanding which mean to use is as important as knowing how to compute it.
Arithmetic mean (AM)
The arithmetic mean is the sum of all values divided by the count:
This is the most intuitive measure of centre. It minimises the sum of squared differences from any candidate value. It is the "least-squares" average. The AM is appropriate for:
- Additive data: heights, temperatures, exam scores, distances
- Any situation where you want to find the value that, if shared equally, gives the same total
- When the data are symmetric and outliers are not a concern
Weakness: The arithmetic mean is highly sensitive to outliers. One extreme value can shift the AM far from the bulk of the data. A salary dataset with one billionaire will have an AM that misleads about the typical worker's pay; the median is a better measure of centre in that case.
Geometric mean (GM)
The geometric mean is the nth root of the product of all values — equivalent to the exponential of the arithmetic mean of the logarithms:
The GM is defined only for strictly positive values. It is the appropriate mean for:
- Multiplicative data / growth rates: If an investment grows by 10% in year 1 and 20% in year 2, the compound annual growth rate is GM(1.10, 1.20) = √(1.10 × 1.20) ≈ 1.1489, or 14.89% , not the arithmetic mean of 15%.
- Ratios and proportions: pH values, aspect ratios, decibel levels (which are logarithmic).
- Scientific measurements spanning orders of magnitude:When data range from 0.001 to 1,000,000, the GM is less distorted by the largest values than the AM.
The geometric mean is always ≤ the arithmetic mean for positive values (AM-GM inequality), with equality only when all values are identical.
Harmonic mean (HM)
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals:
The HM is defined only when all values are non-zero. It is appropriate when averaging rates, situations where the denominator changes but the numerator is fixed:
- Average speed over equal distances: If you travel 60 km at 60 km/h and 60 km at 120 km/h, the average speed is HM(60, 120) = 2 / (1/60 + 1/120) = 80 km/h, not the AM of 90 km/h.
- Price-earnings ratios: When averaging the P/E ratios of equal-dollar investments in different companies.
- Fuel economy: If a car averages 30 mpg on the highway and 20 mpg in the city over equal distances, the combined average is HM(30, 20) = 24 mpg.
The AM-GM-HM inequality
For any set of strictly positive values, the three Pythagorean means always satisfy:
with equality if and only if all values are identical. This is not a coincidence but a theorem with deep connections to convexity; the AM is the average on the linear scale, the GM is the average on the logarithmic scale, and the HM is the average on the reciprocal scale. Each scale makes a different class of problems "additive" and therefore amenable to simple averaging.
For example, with values 1, 2, 4, 8:
- AM = (1 + 2 + 4 + 8) / 4 = 3.75
- GM = (1 × 2 × 4 × 8)^(1/4) = 64^0.25 = 2.83
- HM = 4 / (1 + 0.5 + 0.25 + 0.125) = 2.10
- 2.10 ≤ 2.83 ≤ 3.75 ✓
Weighted means
Each mean has a weighted analogue when values do not contribute equally:
- Weighted AM: Σ(wᵢxᵢ) / Σwᵢ, used for GPAs (credit hours as weights), portfolio returns (value as weights), and any pooling of averages with different group sizes.
- Weighted GM: exp(Σwᵢ ln xᵢ / Σwᵢ), used for indices like the Human Development Index.
- Weighted HM: Σwᵢ / Σ(wᵢ/xᵢ), for equal-cost rather than equal-distance averaging of rates.
Median vs. mean
The median is not a Pythagorean mean. It is the positional middle value. It is:
- Robust to outliers: Adding a billionaire to a wage survey doesn't change the median. The AM would skyrocket.
- Better for skewed distributions: Income, home prices, response times, and many biological measurements are right-skewed. The median (or GM) better represents the "typical" value.
- Used in house prices: Real estate reports typically cite the median sale price, not the mean, for exactly this reason.
Common mistakes
- Averaging percentages with AM: If store A gave a 20% discount and store B gave a 50% discount, the AM of 35% is only correct if both stores had equal sales volumes. For equal customer counts but different spend, the appropriate discount average requires a weighted mean.
- Averaging rates with AM: Speed, efficiency, and productivity are rate quantities, always use the harmonic mean when the base quantity (distance, output) is equal.
- Mixing log-scale data with AM: Earthquake magnitudes, pH, and star brightness are logarithmic scales. The geometric mean is more meaningful than the arithmetic mean for these.
Disclaimer
Results are computed from the values you enter. For scientific, financial, or medical analysis, consult a statistician or domain expert to verify the appropriate measure of centre for your specific data and research question.