Geometric Mean Calculator
Inputs
| Positive values | 2, 8, 32 |
|---|
Results
| Geometric Mean | 8 |
|---|---|
| Arithmetic Mean | 14 |
| Product | 512 |
| Count | 3 |
Geometric Mean Calculator
Calculate the geometric mean, arithmetic mean, and product of a set of positive numbers. Enter comma-separated values to compare the two averages.
Inputs
Results
Details
What is the geometric mean?
The geometric mean of n positive numbers is the nth root of their product. For values x₁, x₂, …, xₙ, the geometric mean G is:
G = (x₁ × x₂ × … × xₙ)^(1/n)
An equivalent and numerically stable form uses logarithms:
G = exp((ln x₁ + ln x₂ + … + ln xₙ) / n)
Both expressions yield the same result, but the logarithmic form avoids overflow when the product of many large numbers would exceed the range of floating-point arithmetic.
When to use the geometric mean
The geometric mean is the appropriate average whenever quantities are multiplied rather than added. The most common applications are:
Rates of return and growth factors. If an investment grows by 20% in year one and falls by 10% in year two, the growth factors are 1.20 and 0.90. The arithmetic mean of these factors is 1.05, which would imply a 5% gain each year — but the actual two-year result is 1.20 × 0.90 = 1.08, a total gain of 8%, equivalent to a constant annual rate of √1.08 ≈ 1.039, or about 3.9%. The geometric mean of 1.20 and 0.90 gives exactly this 3.9% — the arithmetic mean is misleading here.
Price indices and ratios. When averaging ratios or index values across categories with different base units, the geometric mean weights each by the same multiplicative structure rather than letting large absolute values dominate.
Log-normally distributed data. Data that spans several orders of magnitude — bacteria counts, earthquake magnitudes, income distributions — is often better summarized by the geometric mean because it corresponds to the median of the underlying log-normal distribution.
A simple guideline: use the arithmetic mean for additive data (temperatures, distances, test scores) and the geometric mean for multiplicative data (growth factors, price relatives, aspect ratios).
Worked example
Three annual investment returns are 12%, −8%, and 24%. Converting to growth factors: 1.12, 0.92, 1.24.
- Product: 1.12 × 0.92 × 1.24 ≈ 1.2777
- Geometric mean: 1.2777^(1/3) ≈ 1.0851
- Equivalent constant annual rate: 8.51%
- Arithmetic mean of growth factors: (1.12 + 0.92 + 1.24) / 3 ≈ 1.0933, implying 9.33%
The arithmetic mean overstates the sustainable rate because it ignores the compounding interaction between gains and losses. After three years at the geometric mean rate of 8.51%, a 1,278 — matching the actual outcome exactly.
The AM-GM inequality
For any list of positive numbers, the arithmetic mean is always greater than or equal to the geometric mean:
(x₁ + x₂ + … + xₙ) / n ≥ (x₁ × x₂ × … × xₙ)^(1/n)
Equality holds only when all values are identical. The gap between the two means grows with the spread of the data — a useful diagnostic for how variable a dataset is in multiplicative terms.
The AM-GM inequality appears throughout mathematics. One geometric interpretation: among all rectangles with a fixed perimeter, the square (equal side lengths) has the maximum area — the area is the geometric mean of the two side lengths, and it is maximized when both sides are equal, matching the arithmetic mean.
How logarithmic computation avoids overflow
Computing the product of many values directly can cause floating-point overflow even for moderately large datasets. Taking the natural logarithm of each value, averaging the logs, and exponentiating the average sidesteps the problem:
G = exp(mean(ln x₁, ln x₂, …, ln xₙ))
Because log transforms turn multiplication into addition and exponentiation into a scalar, all intermediate values stay in a numerically safe range. This calculator uses this form internally.
Relationship to other means
The geometric mean is one of several Pythagorean means:
- Arithmetic mean (AM): minimizes the sum of squared differences — sensitive to outliers.
- Geometric mean (GM): minimizes the sum of squared differences in log space — natural for multiplicative data.
- Harmonic mean (HM): reciprocal of the average of reciprocals — appropriate for rates and speeds.
For positive data, HM ≤ GM ≤ AM always holds. This calculator computes both GM and AM so you can compare them directly.
Related calculators
- Mean, Median, Mode Calculator — arithmetic mean, median, mode, and range
- Weighted Average Calculator — mean with per-value weights
- Variance and Standard Deviation Calculator — spread of a dataset around its mean
- Descriptive Statistics Calculator — full summary statistics including skewness and kurtosis
Frequently Asked Questions (FAQ)
When should I use the geometric mean instead of the arithmetic mean?
Use the geometric mean when you are combining quantities that are multiplied together — such as growth rates, rates of return, or ratios. For example, if an investment doubles in year one (growth factor 2.0) and then loses half its value in year two (growth factor 0.5), the arithmetic mean of the two rates (+25%) suggests a gain, yet the actual cumulative result is breakeven. The geometric mean of the growth factors (√(2.0 × 0.5) = 1.0) correctly shows a 0% equivalent annual rate.
As a rule of thumb: use the arithmetic mean for additive data (temperatures, lengths, test scores) and the geometric mean for multiplicative data (growth factors, price indices, aspect ratios).
Why must all input values be positive?
The geometric mean is defined as the nth root of the product of n values. If any value is zero, the product collapses to zero and the mean is zero regardless of the other values. If any value is negative, the product of an even count of values can be positive but the result is not meaningful as a "center" of the data, and an odd count produces a negative number with a real nth root that has no sensible interpretation as an average.
In practice, geometric mean is applied to positive-valued quantities such as prices, lengths, population sizes, and return factors — all of which are inherently positive.
How is the geometric mean related to compound growth?
The geometric mean of a series of growth factors is the single constant factor that, applied every period, produces the same final value as the varying factors do. If an investment returns factors r₁, r₂, …, rₙ over n periods, the final value equals the initial value multiplied by the product r₁ × r₂ × … × rₙ. The geometric mean G = (r₁ × r₂ × … × rₙ)^(1/n) is the equivalent constant-per-period factor.
For example, growth factors of 1.20, 0.90, and 1.15 give a geometric mean of approximately 1.075, meaning an equivalent constant growth rate of about 7.5% per period.
What is the AM-GM inequality?
The AM-GM (arithmetic mean – geometric mean) inequality states that for any list of positive numbers, the arithmetic mean is always greater than or equal to the geometric mean, with equality only when all values are identical.
Formally: (x₁ + x₂ + … + xₙ) / n ≥ (x₁ × x₂ × … × xₙ)^(1/n)
The gap between AM and GM grows with the spread of the data. This calculator shows both so you can observe the inequality directly. The inequality has applications across optimization, geometry, and finance.
Recommended Next
Mean, Median, Mode Calculator
Find the mean, median, mode, and range of any dataset. Enter comma-separated numbers to calculate all four measures of central tendency.
Variance and Standard Deviation Calculator
Calculate variance and standard deviation from a comma-separated list of numbers. Switch between sample and population formulas.