IQRCalculator

Geometric Mean Calculator

The average for numbers that multiply together — growth factors, returns, ratios — with the harmonic and arithmetic means for comparison.

Separate values with commas, spaces or new lines. You can paste a column from a spreadsheet.

Result

Geometric mean1.0535392083G = (x₁ · x₂ · … · xₙ)^(1/n)
Arithmetic mean
1.055
Geometric mean
1.0535392083
Harmonic mean
1.0520524362
Count
4
How it was calculated
  1. Add the natural logarithms
    Σ ln x = 0.2086206831

    Working with logarithms avoids overflow when many values are multiplied.

  2. Divide by the number of values
    0.2086206831 ÷ 4 = 0.0521551708
  3. Convert back with the exponential
    G = e^0.0521551708 = 1.0535392083
  4. Harmonic mean
    H = n ÷ Σ(1/x) = 4 ÷ 3.8020918562 = 1.0520524362

For positive values, harmonic mean ≤ geometric mean ≤ arithmetic mean, with equality only when every value is the same.

How to use it

Type or paste your values, separated by commas, spaces or new lines. Every value must be greater than zero. For growth, enter factors, not percentages: a 5% rise is 1.05 and a 3% fall is 0.97.

The formula

G = (x₁ × x₂ × … × xₙ)1/n = exp((ln x₁ + ln x₂ + … + ln xₙ) ÷ n)
H = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ)G — geometric mean; H — harmonic mean; n — number of values, all greater than 0

The two expressions for G are equal. The calculator uses the logarithm form: it adds the natural logarithms, divides by n and converts back with the exponential. Multiplying thousands of values directly could overflow or underflow; adding their logarithms does not.

Worked example: average growth

Four years of growth

Given: growth factors 1.05, 1.12, 0.97, 1.08 (+5%, +12%, −3%, +8%)

  • Σ ln x = 0.2086206831
  • 0.2086206831 ÷ 4 = 0.0521551708
  • G = e0.0521551708 = 1.0535392083

The average growth was about 5.35% a year. Check: 1.05353920834 ≈ 1.2320, the same as the actual four-year product 1.05 × 1.12 × 0.97 × 1.08 = 1.2319776. The arithmetic mean, 1.055, suggests 5.5% a year, but 1.0554 ≈ 1.2388 overstates what happened. The harmonic mean of the same factors is 1.0520524362.

Arithmetic, geometric or harmonic?

For positive values the three always come in the same order:

arithmetic mean ≥ geometric mean ≥ harmonic meanwith equality only when every value is the same
  • Geometric — for quantities that combine by multiplication: growth factors, investment returns, ratios and index numbers. For 2 and 8 it gives 4, because 2 × 8 = 4 × 4.
  • Arithmetic — for quantities that add up: lengths, scores, amounts. The mean calculator covers it in detail.
  • Harmonic — for rates measured over equal amounts of something, such as the average speed over two legs of equal distance.

With 2 and 8 the three means are 5, 4 and 3.2. The more the values vary, the wider the gaps become: for 10 and 1,000 the geometric mean is 100, while the arithmetic mean is 505.

Conventions and limits

  • Zero and negative values are rejected, because the logarithm and the harmonic mean’s 1/x are undefined for them. A loss of 100% or more has no positive growth factor, so no average growth rate can be computed through it.
  • Convert percentages to factors first. Entering the percentages themselves (5, 12, −3, 8) would be rejected because of the negative value — and would be the wrong calculation anyway. Subtract 1 from G to get the average rate.
  • One value is enough: the geometric mean of a single number is that number. Up to 100,000 values are accepted.

Questions

Is the geometric mean the same as CAGR?

Yes, when the values are year-on-year growth factors. The compound annual growth rate is (end value ÷ start value)1/years − 1, and the product of the yearly factors is exactly end ÷ start. For the example above, both give 5.35%.

Why is the geometric mean lower than the ordinary average?

For positive numbers it always is, unless all values are equal (the AM–GM inequality). Variation pulls the geometric mean down: a 50% gain followed by a 50% loss averages 0% arithmetically, but 1.5 × 0.5 = 0.75, a real loss of 25%.

Can I include a zero?

No. Any zero makes the product zero and the logarithm undefined, so the calculator asks for values greater than zero. If zeros are genuine data, the geometric mean is not the right summary for them.

Method & sources