Geometric Mean Calculator | How to Calculate Geometric Mean
Calculate geometric mean for growth rates, investment CAGR, and multiplicative data. Compare AM, GM, and HM with warnings for zeros and negatives.
Mode
Standard GM for any positive numbers
Quick presets
What Is the Geometric Mean Calculator | How to Calculate Geometric Mean?
The geometric mean is the correct way to calculate the average when data values multiply rather than add. Use it for growth rates, ratios, and compound returns, not temperatures or test scores. For example, if a stock returned +10%, +25%, and −10% over three years, the arithmetic mean (8.33%) overstates the true compound return. The geometric mean of the growth factors (1.10, 1.25, 0.90) gives the actual equivalent annual rate: (1.10 × 1.25 × 0.90)^(1/3) − 1 = 7.34%.
The calculator offers three modes: standard geometric mean for any positive numbers, growth rates mode (enters factors directly and shows CAGR), and weighted geometric mean where each value contributes according to an assigned importance weight. The log-average form GM = exp(mean of ln values) is numerically stable for large datasets and is the method used internally for the weighted variant.
Geometric mean is undefined for zero (the product becomes zero) and for negative numbers (the product may have no real nth root). The calculator detects these cases and warns you. All calculations run entirely in the browser.
Formula
How to Use
- 1Choose a mode: Select Geometric Mean for standard use, Growth Rates for compound growth/CAGR, or Weighted GM if each value has a different importance.
- 2Load a preset (optional): Click Investment returns, Population growth rates, Test scores, or Aspect ratios to instantly populate the input with real-world examples.
- 3Enter your numbers: Type up to 50 positive numbers separated by commas, spaces, or newlines in the text area.
- 4Enter weights (Weighted GM only): If you selected Weighted GM, enter the same number of weights in the weights field. Weights do not need to sum to 1, they are normalized automatically.
- 5Press Calculate: Click Calculate or press Enter (without Shift). If any values are negative or zero, a warning appears but computation continues on positive values.
- 6Compare all three means: Result cards show geometric mean, arithmetic mean, and harmonic mean side by side. Verify the HM ≤ GM ≤ AM inequality.
- 7Expand step-by-step: Click "Step-by-step working" to see the product, the nth root computation, and the log-average equivalence shown with your actual numbers.
- 8Copy results: Use the "Copy results" button to copy the summary to your clipboard for use in a spreadsheet or report.
Example Calculation
Example 1, Investment CAGR over 5 years
Annual returns: +5%, +12%, −2%, +7%, +15%
Growth factors: 1.05, 1.12, 0.98, 1.07, 1.15
Product = 1.05 × 1.12 × 0.98 × 1.07 × 1.15 = 1.4164
GM = 1.4164^(1/5) = 1.07195
CAGR = 7.20%
Arithmetic mean of returns = 7.40% (overestimates by 0.20 pp)
Example 2, Population growth rates
Growth factors over 4 years: 1.02, 1.025, 1.018, 1.03
Product = 1.02 × 1.025 × 1.018 × 1.03 = 1.0976
GM = 1.0976^(1/4) = 1.02356
Average annual growth = 2.356%
AM = (1.02+1.025+1.018+1.03)/4 = 1.02325 ≥ GM (confirmed)
Example 3, Aspect ratios (image processing)
Common display ratios: 1.333 (4:3), 1.778 (16:9), 2.35 (CinemaScope), 1.5 (3:2)
Product = 1.333 × 1.778 × 2.35 × 1.5 = 8.367
GM = 8.367^(1/4) = 1.699 — a representative “median” aspect ratio
AM = 1.740 (pulled up by extreme 2.35 value)
GM is more representative of the “typical” ratio in the set
Understanding Geometric Mean | How to Calculate Geometric Mean
How to Calculate Geometric Mean, Step by Step
- 1Collect your n positive numbers (e.g., growth factors 1.10, 1.25, 0.90 for three yearly returns).
- 2Multiply all values together to get the product: 1.10 × 1.25 × 0.90 = 1.2375.
- 3Take the nth root of the product (n = count of values): 1.2375^(1/3) = 1.0734.
- 4Subtract 1 if working with growth factors to convert to a rate: 1.0734 − 1 = 7.34%.
- 5Alternatively, use the log-average: GM = exp(mean of ln values), identical result, numerically stable for large datasets.
What Is the Geometric Mean?
To calculate the geometric mean of n positive numbers, take the nth root of their product. It is one of the three classical Pythagorean means, arithmetic, geometric, and harmonic, each best suited to a different type of data. Use it to calculate the average of growth rates, price ratios, and scaling factors: any data where ratios between values matter more than differences.
Geometric Mean vs Arithmetic Mean in Finance
The difference between geometric and arithmetic mean becomes significant whenever there is volatility in a series of returns. This is called volatility drag or the variance drain: the arithmetic mean always overestimates compound growth. The gap equals approximately half the variance of the return series: GM ≈ AM − σ²/2.
- Low volatility portfolio (+5%, +7%, +6%, +4%): AM = 5.5%, GM = 5.494%, difference negligible.
- High volatility portfolio (+50%, −33%, +50%, −33%): AM = 8.5%, GM = 0.05%, dramatic difference. AM is deeply misleading here.
Choosing the Right Mean
| Situation | Best mean | Why |
|---|---|---|
| Investment compound returns | Geometric | Returns multiply across periods |
| Average speed over equal distance | Harmonic | Distance/speed involves reciprocals |
| Average temperature over time | Arithmetic | Temperatures add linearly |
| Population growth over years | Geometric | Growth factors multiply each year |
| Averaging P/E ratios | Harmonic | Earnings in denominator |
| Aspect ratios of images | Geometric | Ratios are multiplicative |
| Test scores in a class | Arithmetic | Scores are additive quantities |
Frequently Asked Questions
When should I use geometric mean instead of arithmetic mean?
Use geometric mean when values multiply rather than add to produce the quantity of interest:
- • Investment returns and compound growth rates (CAGR)
- • Population growth multipliers over multiple periods
- • Ratios, proportions, and scale-invariant data
- • Data that spans orders of magnitude (pH, decibels, earthquake magnitudes)
- • Geometric properties (aspect ratios, focal lengths)
Use arithmetic mean when values add: heights, temperatures, test scores, distances.
Why is geometric mean always less than or equal to arithmetic mean?
This is the AM-GM inequality, one of the most fundamental results in mathematics:
HM ≤ GM ≤ AM with equality if and only if all values are equal.
Intuitively: the arithmetic mean is pulled upward by large values, while the geometric mean gives proportionally less weight to extremes because it operates in log space. The difference between AM and GM grows with the variance of the dataset.
Why is geometric mean undefined for zero or negative numbers?
Two separate reasons:
- • Zero: the product x₁×…×xₙ = 0 whenever any xᵢ = 0, making GM = 0 regardless of all other values. The zero “swamps” all other information.
- • Negative: the product of an odd number of negatives is negative, and the nth root of a negative number is not a real number (it's complex).
Solutions: for zero-containing data, consider adding a small constant. For mixed-sign data, geometric mean is the wrong tool; use arithmetic mean or consider log-transforming the absolute values.
What is CAGR and how is it related to geometric mean?
CAGR (Compound Annual Growth Rate) is exactly the geometric mean of a series of period growth factors minus 1. If an investment grew by 10%, 25%, and −2% over three years:
CAGR = GM(1.10, 1.25, 0.98) − 1 = 1.1041 − 1 = 10.41%
This is the single constant rate that, applied over 3 years, produces the same final wealth as the actual variable returns. It differs from the arithmetic mean of returns (11%) because of volatility drag, high volatility reduces compound returns below the arithmetic average.
What is the log-average and why is it equivalent to geometric mean?
Taking the nth root of a product is equivalent to exponentiating the arithmetic mean of the logarithms:
GM = exp( mean(ln xᵢ) )
This is numerically more stable for large datasets (avoids floating-point overflow from multiplying many large numbers). The log-average form is preferred in statistics, machine learning, and information theory (entropy is defined in terms of log-averages).
How does weighted geometric mean work?
Weighted geometric mean assigns different importance to each value:
WGM = exp( Σ(wᵢ × ln xᵢ) / Σwᵢ )
This is used in index construction (where some assets are more important), weighted portfolio analysis, and any situation where some observations should count more than others. Weights are automatically normalized to sum to 1.
What is the harmonic mean and when does it beat geometric mean?
The harmonic mean (n / Σ(1/xᵢ)) is the correct average for rates, specifically when you average quantities where the denominator is the variable of interest:
- • Average speed over equal distances (not equal times)
- • Average price-to-earnings ratio of a portfolio
- • Average resistance of parallel resistors
For pure growth rates and multiplicative data, geometric mean is superior. The inequality HM ≤ GM ≤ AM always holds.
Can I use geometric mean for image and audio signal processing?
Yes. Geometric mean appears naturally in several signal processing contexts:
- • Center frequency: the geometric mean of low and high cutoff frequencies of a bandpass filter
- • Geometric mean filter: edge-preserving smoothing by replacing each pixel with the geometric mean of its neighbourhood, less blurring than arithmetic mean
- • PSNR and image quality: geometric mean of quality scores across multiple images
- • Perceptual audio: frequency scaling is logarithmic; octaves are geometric, not arithmetic