Geometric Mean Calculator: Geometric vs Harmonic vs Arithmetic Mean
By FindMySum · Last reviewed
The arithmetic mean, adding the values and dividing by how many there are, is the average most people learn first. It is the right answer when the values add up to something meaningful: total sales, total marks, total kilometres. It gives the wrong answer when the values multiply together, as growth rates and ratios do, or when they are rates measured over equal amounts of something, as speeds over equal distances are. The geometric mean and the harmonic mean cover those two cases. This calculator gives all three side by side, shows each value's logarithm and reciprocal, and has a mode that turns a run of yearly returns into a single average growth rate.
The three formulas
For n positive numbers x₁, x₂, …, xₙ:
| Mean | Formula | Spreadsheet function |
|---|---|---|
| Arithmetic | AM = (x₁ + x₂ + … + xₙ) ÷ n | AVERAGE |
| Geometric | GM = (x₁ × x₂ × … × xₙ)^(1/n) | GEOMEAN |
| Harmonic | HM = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ) | HARMEAN |
Together they are called the Pythagorean means. Multiplying a long list of numbers can overflow a computer's number range, so the calculator works out the geometric mean through logarithms instead, which is mathematically identical:
GM = exp((ln x₁ + ln x₂ + … + ln xₙ) ÷ n)
That is why the breakdown table lists ln x for each value. It also lists 1/x, the pieces of the harmonic mean.
A worked example with the default numbers
The calculator opens with the list from Microsoft's GEOMEAN and HARMEAN help pages: 4, 5, 8, 7, 11, 4, 3.
- Arithmetic mean. The values add to 42, and 42 ÷ 7 = 6.
- Geometric mean. The product is 4 × 5 × 8 × 7 × 11 × 4 × 3 = 147,840. The seventh root of 147,840 is about 5.477. Through logs: the natural logs add to about 11.904, divided by 7 that is about 1.7006, and e^1.7006 ≈ 5.477.
- Harmonic mean. The reciprocals add to about 1.3921, and 7 ÷ 1.3921 ≈ 5.028.
Excel gives the same results: GEOMEAN returns 5.476986969 and HARMEAN 5.028375962. Notice the order: 6 > 5.477 > 5.028.
Why AM ≥ GM ≥ HM
For any list of positive numbers, the arithmetic mean is at least the geometric mean, which is at least the harmonic mean. All three are equal only when every value is the same; the more the values vary, the wider the gaps. A quick illustration with two numbers, 2 and 8: the arithmetic mean is 5, the geometric mean √16 = 4 and the harmonic mean 2 ÷ (0.5 + 0.125) = 3.2.
This ordering is useful as a sanity check. If someone quotes an "average" return that is higher than the simple average of the yearly returns, something has gone wrong, because the compound (geometric) figure can never be above the simple one.
When to use the geometric mean
Use it whenever the values are multiplied together to get the overall result:
- Investment returns. A portfolio that earns 20%, 10%, −5% and 15% in four years grows by 1.20 × 1.10 × 0.95 × 1.15 = 1.4421, or 44.21% in total. The single yearly rate that produces the same growth is 1.4421^(1/4) − 1 ≈ 9.58%. The simple average of the returns is 10%, which overstates what the money actually did.
- Growth of anything. Population, revenue, prices, bacteria: if each period's change is a percentage of the last period's level, the geometric mean of the factors is the typical change.
- Ratios and normalised scores. When comparing items scored relative to a baseline, the geometric mean gives the same ranking whichever item is chosen as the baseline; the arithmetic mean does not.
To use the yearly returns mode, enter the returns as percentages, for example 20, 10, -5, 15. The calculator converts each to a factor, finds the geometric mean, and reports the average growth rate, the simple average and the total growth.
Why gains and losses don't cancel
A 10% gain followed by a 10% loss leaves $100 at $99, not $100: the loss comes off a larger balance. The simple average says 0%, but the geometric average is √(1.10 × 0.90) − 1 ≈ −0.50% a year, which correctly reproduces the 1% total loss. The bigger the swings, the bigger this "volatility drag": a 50% loss needs a 100% gain to get back to even, and the geometric average of −50% and +100% is exactly 0%.
When to use the harmonic mean
Use it for rates when each rate applies to the same amount of the thing in the denominator:
- Speed over equal distances. Drive 60 km at 40 km/h (1.5 hours) and 60 km at 60 km/h (1 hour): 120 km in 2.5 hours is 48 km/h. The harmonic mean of 40 and 60 is 48; the arithmetic mean, 50, is wrong because you spent longer at the slower speed.
- Dollar-cost averaging. If you invest the same dollar amount each month, the average price you paid per unit is the harmonic mean of the monthly prices.
- Price-earnings ratios. The harmonic mean of P/E ratios gives the P/E of an equally weighted portfolio, and is less distorted by one company with tiny earnings.
If the amounts differ (trips of different lengths, different sums invested), use a weighted harmonic mean instead.
Values the calculator rejects
Both means need positive numbers. A zero makes the product zero and the reciprocal 1/0 undefined; a negative value can make the root of the product imaginary. Excel's functions return #NUM! for the same inputs. In the yearly returns mode, a return of −100% or below is rejected, because the factor 1 + r/100 would be zero or negative: an investment cannot lose more than everything and keep compounding.
Reading the results
- If the three means are close, the values are tightly grouped.
- If the geometric mean is well below the arithmetic mean, the values are spread out, often over several orders of magnitude. For 1, 10, 100 and 1,000 the arithmetic mean is 277.75 but the geometric mean is about 31.6: a "typical" value on a multiplicative scale.
- For returns, the gap between the simple average and the average growth rate is roughly half the variance of the returns. Steady returns have almost no gap; volatile returns have a large one.
Limits
The calculator gives unweighted means of the numbers as typed, to 10 significant digits. It does not handle weighted or grouped data, and it does not adjust returns for inflation, fees or contributions. For money added or withdrawn along the way, a money-weighted return (internal rate of return) is the better measure.
More questions
Is the geometric mean the same as CAGR?
Yes, when the inputs are yearly growth factors. The compound annual growth rate from a start value to an end value over n years is (end ÷ start)^(1/n) − 1, and the product of the yearly factors is exactly end ÷ start. So the geometric mean of the factors minus 1 and the CAGR are the same number; the CAGR calculator just starts from the two balances instead of the yearly returns.
Can I average percentages with the geometric mean?
Only after turning them into factors. Taking the geometric mean of 20, 10, −5 and 15 directly is meaningless (and impossible, because of the negative). Convert each to 1 + r/100 first, average the factors, then subtract 1. The calculator's yearly returns mode does this for you.
What is the weighted harmonic mean, and when do I need it?
When the amounts behind each rate differ, each reciprocal is weighted: HM = Σw ÷ Σ(w/x). For fuel economy over trips of different lengths, the weights are the distances. This calculator gives the unweighted mean, which is right when every value covers the same amount (the same distance, the same money invested each time).
Why do index providers use the geometric mean?
Because it treats ratios symmetrically. A price that doubles (×2) and a price that halves (×0.5) average to exactly 1 under the geometric mean, meaning no change on balance, while the arithmetic mean of the ratios is 1.25. Several consumer price indexes, including the elementary aggregates of Canada's CPI for many items, are built from geometric means of price ratios for this reason.
How many decimal places should I report?
Match the precision of your data. The calculator works internally to 40 significant digits and shows up to 10, which is more than any measured input justifies. For returns quoted to one decimal place, report the average growth rate to one or two decimals as well.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.