Geometric and Harmonic Mean Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/9/2026
The geometric mean is calculated with the nth root of the product of the values, and the harmonic mean with n divided by the sum of the reciprocals. For the values 2 and 8, the arithmetic mean is 5, the geometric mean 4, and the harmonic mean 3.2: three different results for the same pair of numbers.
Explanation
The arithmetic mean (the sum divided by the number of values) is the best known, but it isn't always the most appropriate: the geometric mean and the harmonic mean answer different questions about the same data. The geometric mean (the nth root of the product of the values) is the relevant mean for quantities that multiply together rather than add, typically successive growth rates or financial returns over several periods (see our compound interest calculator, where the multiplicative effect of a repeated rate plays the same role). The harmonic mean (the reciprocal of the mean of the reciprocals), on the other hand, suits quantities expressed as a ratio, for example an average speed over legs of equal distance but different speeds (see our average speed calculator for the simple single-speed case). A remarkable mathematical property links all three: for the same set of strictly positive values, the arithmetic mean is always greater than or equal to the geometric mean, which is itself always greater than or equal to the harmonic mean (AM ≥ GM ≥ HM) — strict equality between all three only occurs in the special case where all values are exactly identical, a case where any mean, whatever its definition, necessarily gives back that same value.
Example: the values 2 and 8
Inputs
Values: 2 and 8.
Calculation
Arithmetic mean = (2 + 8) ÷ 2 = 5. Geometric mean = √(2 × 8) = √16 = 4. Harmonic mean = 2 ÷ (1/2 + 1/8) = 2 ÷ 0.625 = 3.2.
Result
The three means are 5, 4, and 3.2 respectively: an ordering (AM > GM > HM) that always holds as soon as the values aren't all identical.
Frequently asked questions
Why is the geometric mean always less than or equal to the arithmetic mean?
This is a general mathematical property (the AM-GM inequality), provable for any set of positive values. Intuitively, the geometric mean "dampens" the effect of extreme values more than the arithmetic mean, because it goes through multiplication rather than addition: a single very small value (close to zero) pulls the geometric mean down sharply, much more than the arithmetic mean of the same data set.
When should you use the harmonic mean rather than the other two?
The harmonic mean is best suited for averaging rates or ratios, especially when the numerator of that ratio (for example a distance traveled) is fixed and identical in each case: averaging speeds over legs of equal distance but traveled at different speeds is the classic example. Using the arithmetic mean in this specific case would give a biased result, overestimating the actual average speed.
Why are zero or negative values not accepted?
The geometric mean requires a product of strictly positive values (a root of a product containing zero or a negative number would pose a mathematical problem), and the harmonic mean requires dividing by each value, which is impossible with a zero. This calculator therefore excludes zero or negative values from its calculation, rather than returning an inconsistent result.