Geometric Mean Calculator
Calculate the geometric mean of a data set. Useful for growth rates, ratios, and log-normal distributions in statistics.
Geometric Mean Calculator
Background.
The geometric mean is the multiplicative analogue of the arithmetic mean, designed for data that grow or combine through multiplication rather than addition. It is the central tendency measure of choice for investment returns, bacterial growth rates, radioactive decay constants, and any domain where percentages or ratios compound over time. While the arithmetic mean adds values and divides by their count, the geometric mean multiplies values and takes the nth root. This distinction is not pedantic: using the arithmetic mean to average investment returns over multiple periods produces an upwardly biased estimate that overstates actual portfolio growth.
Finance professionals search for geometric mean calculators when computing the compound annual growth rate, or CAGR. If a stock rises 100 percent in year one and falls 50 percent in year two, the arithmetic mean return is 25 percent, but an investor who held the stock for both years has exactly zero net growth. The geometric mean return is (2.0 × 0.5)^0.5 − 1 = 0 percent, correctly reflecting the break-even outcome. This property makes the geometric mean essential for backtesting trading strategies, comparing mutual fund performance, and calculating time-weighted returns that neutralize the effect of cash flows.
In the natural sciences, the geometric mean appears wherever data follow log-normal distributions. Particle sizes in aerosols, pollutant concentrations in environmental monitoring, and blood-titer levels in immunology all tend to be right-skewed with a long tail of extreme values. The arithmetic mean is pulled upward by these outliers and no longer represents the typical observation. The geometric mean, because it compresses the scale through logarithms, yields a more robust central estimate that aligns with the median in log-normal data. Fleming and Wallace (1986) demonstrated that the geometric mean is the only correct summary statistic for normalized benchmark results in computer science, a finding now standard in performance engineering.
The computational challenge is numerical stability. The product of 100 values, each near 100, exceeds 10^200 and overflows standard floating-point registers. Conversely, the product of 100 probabilities near 0.01 underflows to zero. The solution is to compute in the logarithmic domain: take the natural logarithm of each value, average those logarithms, and exponentiate the result. This converts multiplication into addition and roots into division, keeping intermediate values within the representable range of IEEE-754 doubles. The calculator implements this log-domain algorithm automatically, producing accurate results for data sets of arbitrary length within memory constraints.
Historical use of the geometric mean dates to ancient Greek mathematics, where it appeared as the mean proportional between two numbers. In a right triangle, the altitude to the hypotenuse is the geometric mean of the two segments it creates. This geometric construction gives the mean its name, even though modern applications are overwhelmingly algebraic and statistical. Today, the geometric mean is one of the three classical Pythagorean means—alongside arithmetic and harmonic—and satisfies the fundamental inequality AM ≥ GM ≥ HM for any set of positive numbers. Its invariance under reference changes makes it indispensable for normalized comparisons across disparate systems and benchmark suites alike. Modern data scientists rely on it whenever multiplicative processes dominate.
What is geometric mean calculator?
The geometric mean of n positive real numbers is the nth root of their product. It is defined only for positive inputs because the product of non-positive numbers may be negative or zero, and the nth root of a negative number is not real when n is even. The formula is GM = (Π x_i)^(1/n), where Π denotes the product over all i from 1 to n. An equivalent and computationally preferable form is GM = exp( (1/n) Σ ln(x_i) ), where ln is the natural logarithm and exp is its inverse. The geometric mean is always less than or equal to the arithmetic mean, with equality holding if and only if all values are identical. This relationship, known as the AM-GM inequality, is one of the most important results in mathematical analysis and has applications in optimization, information theory, and geometry. The geometric mean shares the same units as the input data—percentages, dollars, meters—but its interpretation differs: it represents the constant rate that would produce the same cumulative product as the observed varying rates. When data are log-normally distributed, the geometric mean coincides with the median of the underlying normal distribution, providing a robust central estimate that resists the upward bias of extreme outliers.
How to use this calculator.
- Enter your data values as comma-separated positive numbers in the text area.
- Ensure every value is greater than zero; the geometric mean is undefined otherwise.
- Include at least two values to compute a meaningful mean.
- Click calculate to display the geometric mean.
- Review the count and arithmetic mean shown for comparison.
- Use the result for CAGR calculations, ratio averaging, or log-normal data summary.
The formula.
The product definition GM = (x_1 × x_2 × ... × x_n)^(1/n) is intuitive but computationally fragile. In JavaScript, the maximum finite double-precision value is approximately 1.798e308. The product of 100 numbers each equal to 100 is 10^200, which fits safely, but the product of 200 such numbers is 10^400 and overflows to Infinity. Underflow is equally problematic: the product of 200 probabilities of 0.01 is 10^-400, which rounds to zero. Once the product is zero or Infinity, the nth root cannot recover the correct mean. The logarithmic transformation solves both problems. Because ln(a × b) = ln(a) + ln(b), the product becomes a sum: ln(GM) = (1/n) Σ ln(x_i). Exponentiating both sides yields GM = exp( (1/n) Σ ln(x_i) ). Sums of logarithms stay within the representable range far longer than products of raw values. For 200 values of 100, the sum of logs is 200 × 4.605 = 921, well within double limits. For 200 values of 0.01, the sum is 200 × (-4.605) = -921, also safe. The division by n and final exponentiation return a finite, accurate result. The AM-GM inequality states that for any set of positive numbers, the arithmetic mean is greater than or equal to the geometric mean. A short proof uses Jensen's inequality applied to the convex function −ln(x). Because −ln is convex, the average of the function values is at least the function of the average: −ln(AM) ≤ average(−ln(x_i)) = −ln(GM). Multiplying by −1 reverses the inequality, yielding AM ≥ GM. Equality holds only when all x_i are identical. This inequality explains why the arithmetic mean of investment returns always overstates growth: it is systematically larger than the geometric mean unless every period returns exactly the same rate. Dimensional analysis confirms that GM carries the same units as the inputs. The logarithm is dimensionless only when applied to dimensionless ratios; when applied to dimensional quantities, the result retains implicit units. In practice, geometric means are applied to ratios, growth factors, or normalized quantities where the dimensionless interpretation is natural. The calculator accepts any positive real numbers and returns a geometric mean in the same numerical scale.
A worked example.
Consider an investment that doubles in value during the first year and then loses half its value during the second year. The growth factors are 2.0 and 0.5. The arithmetic mean of these factors is (2.0 + 0.5) / 2 = 1.25, which naively suggests a 25 percent average growth rate. However, an investor who held this asset for both periods would have exactly the same amount at the end as at the beginning: $1.00 becomes $2.00 after year one, then falls back to $1.00 after year two. The geometric mean correctly captures this break-even outcome: GM = (2.0 × 0.5)^(1/2) = 1.0^0.5 = 1.0. The average growth factor is therefore 1.0, implying zero net growth. To express this as a percentage return, subtract 1: 1.0 − 1 = 0 percent. This example, adapted from introductory finance textbooks, demonstrates why regulators such as the SEC require that mutual fund returns be reported as geometric (time-weighted) averages rather than arithmetic averages. Using the arithmetic mean would mislead investors into believing their portfolios grew when they merely oscillated.
Frequently asked questions.
When should I use geometric mean instead of arithmetic mean?
Can geometric mean handle negative numbers?
How is geometric mean used in finance?
What is the relationship between GM and logarithms?
Is geometric mean always less than arithmetic mean?
How do I calculate geometric mean of percentages?
What is the geometric standard deviation?
Can I compute geometric mean with zeros in the data?
Why is GM used for benchmark scores?
How does GM handle missing data?
References& sources.
- [1]NIST SP 811 (2008). Guide for the Use of the International System of Units (SI). https://www.nist.gov/pml/special-publication-811
- [2]Aitchison, J. (1986). The Statistical Analysis of Compositional Data. London: Chapman and Hall.
- [3]Kendall, M.G., Stuart, A. (1977). The Advanced Theory of Statistics, Vol. 1: Distribution Theory, 4th ed. London: Charles Griffin.
- [4]Fleming, P.J., Wallace, J.J. (1986). "How not to lie with statistics: the correct way to summarize benchmark results." Communications of the ACM 29(3):218-221. doi:10.1145/5666.5673
- [5]NIST/SEMATECH (2012). e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled