What this calculator does
This tool takes a list of numbers and returns the three classic "averages" used in mathematics and statistics: the arithmetic mean, the geometric mean, and the harmonic mean. It also reports the median, the minimum, and the maximum. The math is pure and dimensionless, so it applies identically everywhere with no unit conversion.
How to use it
Type or paste your data into the box, separated by commas, spaces, or new lines — for example 4, 8, 16 or one value per line. Blank or non-numeric entries are ignored, and \(n\) is the count of valid numbers. Choose the number of significant digits for display (this affects only how the answers are rounded, not the underlying math).
The formulas explained
The arithmetic mean adds all values and divides by \(n\). The geometric mean multiplies all values and takes the \(n\)-th root; it is computed numerically as exp(mean of natural logs), which is only valid when every value is positive. The harmonic mean is \(n\) divided by the sum of reciprocals and requires every value to be non-zero. The median sorts the values and takes the middle one (or the average of the two middle values when \(n\) is even).
$$ A = \frac{1}{n}\sum_{i=1}^{n} x_i, \qquad G = \sqrt[n]{\prod_{i=1}^{n} x_i}, \qquad H = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}} $$ $$ \text{where}\quad \left\{ \begin{aligned} x_i &= \text{Data values} \\ n &= \text{count of values} \end{aligned} \right. $$
Worked example
For the data 1, 2, 3, 4, 5 (\(n = 5\)): arithmetic mean = $$ \frac{15}{5} = 3 $$ geometric mean = $$ 120^{1/5} \approx 2.605171085 $$ harmonic mean = $$ \frac{5}{1 + 0.5 + 0.333\ldots + 0.25 + 0.2} \approx 2.189781022 $$ median = 3; minimum = 1; maximum = 5. Notice that \(2.1898 \le 2.6052 \le 3\), confirming the AM-GM-HM inequality.
When the Means Diverge: Scenario Comparison
The three classical means coincide only when every value in the dataset is identical. As soon as the values spread out, the arithmetic mean (AM) sits highest, the harmonic mean (HM) sits lowest, and the geometric mean (GM) lands between them. The wider the spread, the larger the gaps. The table below shows several realistic datasets with each mean computed to 4 decimal places.
| Dataset | Character | Arithmetic (A) | Geometric (G) | Harmonic (H) | A − H gap |
|---|---|---|---|---|---|
| 5, 5, 5, 5 | All equal | 5.0000 | 5.0000 | 5.0000 | 0.0000 |
| 2, 4, 6, 8 | Evenly spaced | 5.0000 | 4.4267 | 3.8400 | 1.1600 |
| 1.05, 1.10, 1.20 | Growth factors | 1.1167 | 1.1146 | 1.1125 | 0.0042 |
| 1, 10, 100 | Highly skewed | 37.0000 | 10.0000 | 2.7027 | 34.2973 |
| 40, 60 | Two speeds (km/h) | 50.0000 | 48.9898 | 48.0000 | 2.0000 |
Notice the equal-value row: all three means are exactly 5 and the gap is zero. The "1, 10, 100" row is the opposite extreme — the values span two orders of magnitude, so the arithmetic mean (37) is dominated by the largest value while the harmonic mean (≈2.70) is pulled toward the smallest. The geometric mean (exactly 10) sits at the center of the multiplicative scale.
Choosing the Right Mean
Each mean answers a different question, and using the wrong one can produce a misleading "average." The choice depends on how the underlying quantities combine.
- Arithmetic mean (A) — use for additive quantities, where totals are meaningful: test scores, heights, temperatures, daily counts, or dollar amounts. It is the value that, repeated \(n\) times, gives the same sum as the data.
- Geometric mean (G) — use for multiplicative quantities, ratios, and compounding growth: investment returns, population or revenue growth rates, index numbers, and anything measured as a percentage change over time. Averaging growth factors (e.g. 1.05, 1.10, 1.20) with the geometric mean gives the constant rate that reproduces the same cumulative result — the same logic behind a compound annual growth rate.
- Harmonic mean (H) — use when averaging rates defined relative to a fixed quantity: average speed over equal distances, price-to-earnings (P/E) ratios across a portfolio, or fuel efficiency. If you drive one segment at 40 km/h and an equal segment at 60 km/h, your average speed is the harmonic mean, 48 km/h, not the arithmetic 50 km/h.
For any list of positive numbers the means always satisfy the inequality $$A \ge G \ge H,$$ with equality holding only when every value is identical. The greater the dispersion in the data, the wider these gaps grow — which is why the geometric mean is the conservative choice for compounding returns and the harmonic mean is the correct (lowest) choice when slow rates should weigh more heavily.
This is general educational information about statistical averages, not professional financial advice. When the figures drive an investment or business decision, consult a qualified professional.
FAQ
Why is the geometric mean shown as N/A? The real \(n\)-th root of a product is undefined when any value is negative, so the tool flags negative inputs. A single zero makes the product (and the geometric mean) zero.
Why does a zero break the harmonic mean? The harmonic mean divides by the sum of reciprocals, and \(1/0\) is infinite, so the harmonic mean is undefined when any value is zero.
Which mean should I use? Use the arithmetic mean for additive quantities, the geometric mean for rates of growth or ratios, and the harmonic mean for averaging rates such as speeds.