Geometric Mean Calculator
Enter values in the Calculate tab first, then return here for the full worked solution.
No data yet — enter values in the Calculate tab first.
What Is the Geometric Mean?
The geometric mean is the nth root of the product of n positive numbers. For a dataset of three values {4, 16, 64}: GM = √³(4 × 16 × 64) = √³4,096 = 16. Unlike the arithmetic mean, it measures multiplicative growth, making it the correct average for growth rates, ratios, and financial returns.
The name comes from geometry. When you have two numbers, their geometric mean is the side length of a square with the same area as the rectangle those two numbers define. Take {4, 9}: a 4 × 9 rectangle has area 36, and a 6 × 6 square has the same area — so GM(4, 9) = 6, while AM(4, 9) = 6.5.
The Geometric Mean Formula
There are two equivalent forms. Both produce identical results. Use the product form for small datasets; use the log form for large datasets or when writing code.
Product Form (Primary)
GM = (x₁ × x₂ × ... × xₙ)^(1/n)
= (∏ xᵢ)^(1/n)
Where:
xᵢ = each individual positive value
n = count of values
∏ = multiply all values together
Log Form (Alternative)
GM = e^((∑ ln xᵢ) / n)
Steps:
1. Take ln of each value
2. Average those ln values
3. Raise e to that average
Equivalent: 10^((∑ log xᵢ) / n)
CAGR Formula
CAGR = GM of multipliers − 1
= (End / Start)^(1/n) − 1
Convert rates to multipliers first:
+20% return → multiplier 1.20
−10% return → multiplier 0.90
Weighted Geometric Mean
WGM = (∏ xᵢ^wᵢ)^(1/∑wᵢ)
Log form:
WGM = e^(∑(wᵢ × ln xᵢ) / ∑wᵢ)
Used for price indices, weighted
portfolio CAGR, sub-group combining
The log form reveals what the geometric mean actually is: the arithmetic mean computed in log space, then converted back. Because logarithms turn multiplication into addition (ln(a × b) = ln(a) + ln(b)), this avoids the overflow problem that occurs when multiplying many large numbers together. Penn State’s STAT 415 course covers this transformation in the context of likelihood estimation.
Common Geometric Mean Reference Values
Three clean datasets that produce easily verifiable geometric means — useful for checking your calculator or code output.
When to Use the Geometric Mean — Decision Guide
Choosing the right mean depends on the structure of your data, not convention. The key question is whether your data is additive or multiplicative.
Table: Geometric Mean vs Arithmetic Mean vs Harmonic Mean
| Mean | Use when | Do not use when | Worked example |
|---|---|---|---|
| Arithmetic | Data is additive — counts, scores, temperatures; values may be negative | Data represents growth rates or ratios | Avg exam score: (78 + 85 + 91) / 3 = 84.7 |
| Geometric | Data is multiplicative — growth factors, ratios, percentages; all values must be > 0 | Dataset contains 0 or genuine negative values; data is additive | Avg annual return: GM(1.20, 0.90, 1.15) ≈ 1.079 → 7.9%/yr |
| Harmonic | Averaging rates with a fixed common denominator (speed for equal distances, price per unit) | Data is not in rate form; numerators vary | Avg speed for 2 equal distances at 60 and 40 km/h: HM = 48 km/h |
Two common mistakes. First, averaging investment returns with the arithmetic mean: a +50% gain followed by a −50% loss leaves you at 75 cents on the dollar, not break-even. The AM says 0%/yr; the GM correctly gives −13.4%/yr. Second, using the geometric mean for exam scores: 67 and 88 average to 77.5 by arithmetic mean. The GM gives √(67 × 88) ≈ 76.8 — lower and misleading, because scores don’t multiply.
How to Calculate the Geometric Mean — Step by Step
Method A (product form) works for small datasets. Method B (log form) works for any size. Both must give the same answer; running both is a free accuracy check.
Method A — Product Form: Dataset {4, 16, 64}
n = 3
4 × 16 × 64 = 4,096
4,096^(1/3) = 16
16³ = 4,096 ✓ — applying the geometric mean three times reproduces the original product.
Result: GM = 16. Notice the arithmetic mean of the same dataset is (4 + 16 + 64) / 3 = 28 — much higher, because it is pulled upward by 64. The geometric mean resists that pull.
Method B — Log Form: Dataset {2, 3, 5, 7}
ln(2) = 0.6931 · ln(3) = 1.0986 · ln(5) = 1.6094 · ln(7) = 1.9459
(0.6931 + 1.0986 + 1.6094 + 1.9459) / 4 = 5.3470 / 4 = 1.3368
GM = e^1.3368 ≈ 3.807
2 × 3 × 5 × 7 = 210; 210^(1/4) ≈ 3.807 ✓
📈 CAGR — The Most Important Application of the Geometric Mean
CAGR (Compound Annual Growth Rate) is the geometric mean of a series of annual growth multipliers, minus 1. It answers one precise question: if this investment had grown at a single constant rate each year, what rate would exactly reproduce the final value? The arithmetic mean cannot answer that question because it ignores compounding.
Worked Example — 5-Year Investment Portfolio
Table: Annual Returns and Multipliers
| Year | Return | Multiplier (1 + rate) |
|---|---|---|
| Year 1 | +20% | 1.20 |
| Year 2 | +15% | 1.15 |
| Year 3 | −10% | 0.90 |
| Year 4 | +25% | 1.25 |
| Year 5 | +5% | 1.05 |
1.20 × 1.15 × 0.90 × 1.25 × 1.05 = 1.6301
GM = 1.6301^(1/5) ≈ 1.1026
CAGR = 1.1026 − 1 = 10.26% per year
$10,000 × 1.1026&sup5; ≈ $10,000 × 1.6295 ≈ $16,295 ✓ (actual: $16,301; rounding only)
📊 AM vs GM Error by Volatility — Benchmark Dataset
The table below shows how the gap between arithmetic mean and geometric mean grows with the volatility (spread) of the returns. This gap is called volatility drag and directly reduces compound returns below what simple averaging would predict.
Table: Arithmetic Mean vs Geometric Mean Error by Return Volatility
| Returns (5 years) | AM (%/yr) | GM / CAGR (%/yr) | Drag (AM − GM) | $10K error over 5yr |
|---|---|---|---|---|
| Low vol: +6, +7, +5, +8, +4% | 6.00% | 5.99% | 0.01 pp | <$1 |
| Medium vol: +20, +15, −10, +25, +5% | 11.00% | 10.26% | 0.74 pp | ≈$550 |
| High vol: +50, +30, −25, +40, −5% | 18.00% | 14.78% | 3.22 pp | ≈$4,000 |
| Extreme: +100, −50, +80, −40, +60% | 30.00% | 14.87% | 15.13 pp | ≈$12,000 |
Key takeaway: for low-volatility data the two means are nearly identical. As volatility rises, the arithmetic mean increasingly overstates compound growth. Using AM to report investment performance is a systematic upward bias.
Zeros and Negatives — What to Do
The geometric mean is undefined for any dataset containing a zero or a genuine negative value. Two distinct situations require different handling — confusing them produces incorrect results.
When your dataset contains a zero
ln(0) = −∞, so the formula breaks. The product of the values collapses to zero regardless of all other values. Scenario A — zero is a measurement artifact: In environmental and laboratory data, instruments have a detection limit. A recorded “zero” means “below detection limit, unknown.” Replace each such zero with:
- ½ × the detection limit (most widely recommended)
- The detection limit minus one significant digit
- A small constant added to all values, subtracted from the final GM
Scenario B — zero is a genuine value: One month of zero sales, one species with zero observations. Here the geometric mean is not appropriate. Use the arithmetic mean or report the zero values separately and document the exclusion.
When your dataset contains negative values
Scenario A — negative percentage changes (convert to multipliers): A −15% investment return is not a truly negative number — it is a rate. Convert it: −15% → 1 + (−0.15) = 0.85. Apply the geometric mean to the positive multipliers, then convert back: (GM − 1) × 100 gives the percentage rate.
Scenario B — genuinely negative values (temperatures, altitude, deviations): No conversion exists. The geometric mean is undefined and inappropriate. Use the arithmetic mean instead.
Data has negatives? → Percentage changes: convert to multipliers, apply GM, convert back. Genuine negatives: use AM.
Geometric Mean vs Arithmetic Mean — Complete Comparison
The geometric mean is always less than or equal to the arithmetic mean for any set of positive, non-identical values (Jensen’s inequality: AM ≥ GM). Equality holds only when all values are identical.
Table: GM vs AM Properties
| Property | Geometric Mean | Arithmetic Mean |
|---|---|---|
| Formula | (∏xᵢ)^(1/n) | ∑xᵢ / n |
| Data type | Multiplicative (rates, ratios, growth) | Additive (counts, scores, temperatures) |
| Handles negatives? | No (via multiplier conversion for rates) | Yes |
| Handles zeros? | No (see workarounds above) | Yes |
| Skewed data | Less distorted by outliers | Pulled toward extreme values |
| Inequality | Always ≤ AM for positive non-identical data | Always ≥ GM |
| Finance use | CAGR, index construction (Consumer Price Index) | Simple average of returns (usually wrong) |
With skewed data {1, 1, 1, 1, 100}: AM = 20.8 (pulled hard by the outlier) · GM = 100^(1/5) ≈ 2.51 (stays near the typical value) · Median = 1.
For right-skewed ratio data, GM sits much closer to the typical value.
📊 Worked Case Studies
Case Study 1 — Population Growth Rate
Multipliers: 1.4, 1.287, 1.527 — n = 3
1.4 × 1.287 × 1.527 = 2.7510
2.7510^(1/3) ≈ 1.400 per 5-year period
Interpretation: The city grew at an average compound rate of approximately 1.400 — a 40% increase — per five-year period. Using the arithmetic mean (1.405) would overstate the compound growth by 0.5 percentage points per period, compounding into a meaningful error over decades.
Case Study 2 — Machine Efficiency Comparison
GM(1.10, 1.08, 1.05) = (1.10 × 1.08 × 1.05)^(1/3) = 1.2474^(1/3) ≈ 1.0765
GM(1.20, 0.95, 0.90) = (1.20 × 0.95 × 0.90)^(1/3) = 1.0260^(1/3) ≈ 1.0085
Machine A GM (1.0765) > Machine B GM (1.0085) — Machine A is more efficient on average.
Interpretation: Machine A’s consistent modest gains outperform Machine B’s volatile pattern. This is a common pitfall: published textbook examples sometimes read the geometric means backwards, concluding the wrong machine is better. Always compare the actual numbers before interpreting “greater output.”
Case Study 3 — Weighted Portfolio CAGR
Multipliers: A = 1.12, B = 1.08, weights 0.60 and 0.40.
WGM = e^(0.60 × ln(1.12) + 0.40 × ln(1.08)) = e^(0.60 × 0.11333 + 0.40 × 0.07696) = e^0.09878 ≈ 1.1038
Result: Weighted portfolio CAGR ≈ 10.38%/year. The unweighted GM of {1.12, 1.08} gives 9.98%/yr — meaningfully different, because Asset A receives more weight.
How to Calculate Geometric Mean in Excel, Python, and R
Excel has a built-in =GEOMEAN() function that accepts a cell range or individual values. It returns #NUM! if any value is zero or negative.
’ Basic usage
=GEOMEAN(A1:A5) ’ GM of values in A1 through A5
=GEOMEAN(4, 16, 64) ’ Direct entry → returns 16
’ CAGR from annual multipliers
=GEOMEAN(1.20, 1.15, 0.90, 1.25, 1.05) - 1 ’ → 0.1026 (10.26%)
’ CAGR from start and end values only
=(B10/B5)^(1/5) - 1 ’ B10=end value, B5=start value, 5=years
’ Troubleshooting: if you see #NUM!, run this to find zeros/negatives
=MIN(A1:A5) ’ Must be > 0 for GEOMEAN to work
Two equivalent methods — scipy.stats.gmean and the manual log method. Both return identical results for positive data. Always validate inputs first.
import numpy as np
from scipy import stats
data = [4, 16, 64]
# Method 1: scipy.stats.gmean — clean, requires all positive values
gm_scipy = stats.gmean(data)
print(f"GM (scipy): {gm_scipy:.4f}") # 16.0000
# Method 2: numpy log method — identical result
gm_log = np.exp(np.mean(np.log(data)))
print(f"GM (log): {gm_log:.4f}") # 16.0000
# CAGR from annual multipliers
returns = [1.20, 1.15, 0.90, 1.25, 1.05]
cagr = stats.gmean(returns) - 1
print(f"CAGR: {cagr:.2%}") # 10.26%
# WARNING: np.log() silently returns NaN for negatives, -inf for zero.
# Always validate before computing:
if any(x <= 0 for x in data):
raise ValueError("All values must be positive for geometric mean")
Base R has no built-in geomean() function. The exp(mean(log(x))) idiom is standard; the psych package adds a named version if preferred.
# Method 1: manual log method (base R, no packages needed)
data <- c(4, 16, 64)
geo_mean <- exp(mean(log(data)))
cat("Geometric mean:", geo_mean, "\n") # 16
# Method 2: psych package
# install.packages("psych")
library(psych)
geometric.mean(data) # 16
# CAGR from annual multipliers
returns <- c(1.20, 1.15, 0.90, 1.25, 1.05)
cagr <- exp(mean(log(returns))) - 1
cat(sprintf("CAGR: %.2f%%\n", cagr * 100)) # 10.26%
# Input validation
if (any(data <= 0)) stop("All values must be positive")
Geometric Mean: Complete Formula and Entity Reference
The table below covers every key formula and concept associated with the geometric mean, structured for quick reference.
Table: Geometric Mean Formula Glossary — 11 Key Entities
| Term | Symbol / Formula | Plain-English Definition | Primary Use |
|---|---|---|---|
| Geometric Mean (GM) | (∏xᵢ)^(1/n) | nth root of the product of n positive values; correct central tendency for multiplicative data | Growth rates, ratios, financial returns |
| Arithmetic Mean (AM) | ∑xᵢ / n | Sum divided by n; correct for additive data where values may be negative | Test scores, temperatures, counts |
| Harmonic Mean (HM) | n / ∑(1/xᵢ) | n divided by sum of reciprocals; correct for rate data with a fixed denominator | Speed for equal distances, price per unit |
| Product (∏) | x₁ × x₂ × … × xₙ | All n values multiplied together | First step in product-form GM calculation |
| nth root | x^(1/n) | Value that, raised to the nth power, returns x; equivalent to raising to 1/n | Second step in product-form GM calculation |
| Natural logarithm (ln) | log base e | Converts products to sums: ln(a×b) = ln(a) + ln(b) | Log-form GM computation; avoids overflow |
| Growth factor / multiplier | 1 + (rate/100) | Converts a percentage change to a multiplicative value compatible with GM | Converting % returns for CAGR calculation |
| CAGR | GM of multipliers − 1 | Compound Annual Growth Rate; single constant rate that reproduces the final value | Investment performance, revenue growth |
| Jensen’s Inequality | AM ≥ GM | Proves AM is always ≥ GM for positive non-identical data; equality only when all values identical | Proves GM understates AM for volatile data |
| Weighted GM | e^(∑wᵢ ln xᵢ / ∑wᵢ) | GM where each value is raised to its weight before the product is taken | Price index construction; weighted portfolio CAGR |
| Detection limit | — | Smallest measurable value for an instrument; zeros below this threshold are replaced (½ × detection limit) when computing GM | Environmental science data handling |
Related Topics and Calculators on Statistics Fundamentals
The geometric mean connects to descriptive statistics, probability, finance, and data science. These resources build the complete picture.
Sources and Further Reading
Authority sources cited in this guide:
- Penn State STAT 415. Introduction to Mathematical Statistics — Interval Estimation and Likelihood. online.stat.psu.edu
- National Institute of Standards and Technology (NIST). Engineering Statistics Handbook — Measures of Location. itl.nist.gov
- OpenStax. Introductory Statistics, Chapter 2: Descriptive Statistics. openstax.org
- U.S. Bureau of Labor Statistics. Consumer Price Index: Geometric Mean Formula in CPI Calculation. bls.gov
- Devore, J.L. Probability and Statistics for Engineering and the Sciences, 9th ed. Cengage Learning, 2016.
- Bland, J.M. & Altman, D.G. (1996). “Statistics Notes: Transformations, means, and confidence intervals.” BMJ 312:1079.
Frequently Asked Questions
The geometric mean is the nth root of the product of n positive numbers. For the values 4, 16, and 64, the geometric mean is ³√(4 × 16 × 64) = ³√4,096 = 16. Unlike the arithmetic mean, it measures multiplicative growth, making it the correct average for growth rates, ratios, and financial returns.
Multiply all values together to get the product, then take the nth root (where n is the count of values). For example, the geometric mean of 2, 8, and 32 is ³√(2 × 8 × 32) = ³√512 ≈ 7.94. For large datasets, use the log method: take the natural log of each value, average those logs, then raise e to that average.
The geometric mean formula is GM = (x₁ × x₂ × ... × xₙ)^(1/n). The equivalent log form is GM = e^((∑ ln xᵢ) / n). Both formulas produce identical results; the log form is preferred for large datasets to avoid overflow.
Use the geometric mean when your data represents growth rates, ratios, or multiplicative processes — such as investment returns, population growth factors, or efficiency ratios. Use the arithmetic mean for additive data: test scores, temperatures, distances. If applying the average repeatedly as a growth factor reproduces the final value, the geometric mean is correct.
CAGR (Compound Annual Growth Rate) is the geometric mean of annual growth multipliers, minus 1. For returns of +20%, +15%, −10%, +25%, +5%, the multipliers are 1.20, 1.15, 0.90, 1.25, 1.05. Their geometric mean is ≈ 1.1026, so CAGR = 10.26% per year. The arithmetic mean (11%) overstates performance because it ignores the compounding effect of losses.
Not directly. The logarithm of a negative number is undefined in real arithmetic. If your dataset contains negative percentage changes (such as investment losses), convert them to growth multipliers first: a −15% return becomes 1 + (−0.15) = 0.85. Apply the geometric mean to the positive multipliers, then convert back by subtracting 1 and multiplying by 100. If your values are genuinely negative (temperatures, altitudes), use the arithmetic mean instead.
If your dataset contains a zero, the geometric mean returns 0 — usually meaningless. If the zero represents a measurement below an instrument’s detection limit, replace it with half the detection limit. If the zero represents a genuine absence of the quantity being measured, the geometric mean is not appropriate; use the arithmetic mean or report the zero values separately.
The geometric mean of 2 and 8 is √(2 × 8) = √16 = 4. Geometrically, 4 is the side length of a square with the same area as a 2 × 8 rectangle (both have area 16).
Yes, for datasets containing at least two distinct positive values. The geometric mean is always less than or equal to the arithmetic mean (Jensen’s inequality: AM ≥ GM), with equality only when all values are identical. For investment returns of +20%, +15%, −10%, +25%, +5%: AM = 11.0%/yr and GM = 10.26%/yr — a gap compounding to roughly $550 on a $10,000 portfolio over five years.
The weighted geometric mean assigns different importance to each value: WGM = (x₁^w₁ × x₂^w₂ × … × xₙ^wₙ)^(1/∑wᵢ). It is used for constructing price indices where different goods have different expenditure weights (the Consumer Price Index uses weighted geometric means), or combining investment returns where each asset has a different portfolio allocation.
Use the built-in =GEOMEAN(A1:A5) function. For CAGR from annual multipliers, use =GEOMEAN(multipliers)-1. For CAGR from just start and end values, use =(end/start)^(1/n)-1. The function returns #NUM! if any value in the range is zero or negative — check with =MIN(range) first.
If the geometric mean equals the arithmetic mean, all values in the dataset are identical. This follows from Jensen’s inequality (AM ≥ GM), where equality holds only when there is no variation. For example, both means of {7, 7, 7} equal 7.