Harmonic Mean Calculator
Paste or type any list of positive numbers. The calculator returns the harmonic mean — the right average for rates and ratios — alongside the geometric and arithmetic means for comparison.
Harmonic mean
1.7142857143
- Geometric mean
- 2
- Arithmetic mean
- 2.3333333333
- Sum
- 7
- Minimum
- 1
- Maximum
- 4
- Count
- 3
Calculated from 3 values. The harmonic mean is n ÷ Σ(1/xᵢ) — useful for averaging rates such as speeds, prices, or per-unit costs over a fixed quantity.
How to use this calculator
Type or paste positive numbers into the input. Separators can be commas, spaces, tabs, semicolons or new lines — mix them however you like. The headline result is the harmonic mean; the breakdown shows the geometric mean, arithmetic mean, sum, minimum, maximum and count so you can see how the three classical means relate. The harmonic mean is only defined for strictly positive values, so any zero or negative number will halt the calculation with a clear error.
How the calculation works
The harmonic mean of n positive numbers is defined as n divided by the sum of their reciprocals: HM = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ). Equivalently, it is the reciprocal of the arithmetic mean of the reciprocals. For any positive dataset it satisfies the AM-GM-HM inequality, HM ≤ GM ≤ AM, with equality only when every value is identical. The harmonic mean is the correct average whenever the quantity being averaged is a rate over a fixed second quantity — for example, averaging speeds when each leg covers the same distance, or averaging price-to-earnings ratios across a portfolio of equal-weighted holdings.
Worked example
For the values 1, 2, 4: the reciprocals are 1, 0.5 and 0.25, which sum to 1.75. The harmonic mean is 3 ÷ 1.75 = 12/7 ≈ 1.7143. The geometric mean is ∛(1 × 2 × 4) = ∛8 = 2, and the arithmetic mean is (1 + 2 + 4) ÷ 3 ≈ 2.333 — illustrating HM ≤ GM ≤ AM. As a practical application: a car drives 60 km at 30 km/h then 60 km at 60 km/h. The average speed for the whole trip is the harmonic mean of 30 and 60: 2 ÷ (1/30 + 1/60) = 2 ÷ (3/60) = 40 km/h. The arithmetic mean of 30 and 60 is 45 — using it here would overstate the true average speed.
Frequently asked questions
When should I use the harmonic mean instead of the arithmetic mean?
Use the harmonic mean whenever you are averaging rates — speed, fuel economy, price-to-earnings, throughput, or any other "X per unit of Y" — and each rate applies to the same amount of Y (distance, time, money). The arithmetic mean of two speeds is correct only when you spend equal time at each speed; if you cover equal distance at each speed, the true average is the harmonic mean. The classic shortcut: average rates with the harmonic mean, average totals with the arithmetic mean.
Why does the calculator reject zero and negative numbers?
The harmonic mean is defined only for strictly positive real numbers, because the formula divides by each value. A zero would make a reciprocal infinite and collapse the harmonic mean to zero, while a negative value would make the result mathematically defined but meaningless for the rate-averaging applications harmonic means are used for. By convention the calculator halts and asks you to clean the input rather than silently produce a misleading result.
How does the harmonic mean relate to the geometric and arithmetic means?
For any set of positive numbers, HM ≤ GM ≤ AM — the harmonic mean is the smallest, the arithmetic mean is the largest, and the geometric mean sits between them. The three are equal only when every value in the dataset is the same. The further apart the values, the larger the gap between the three means. The calculator shows all three so you can compare them and pick the one that fits the question you are actually asking.
Can the harmonic mean be used for averaging speeds?
Yes — that is its most famous application. If you cover the same distance at several different speeds, the average speed over the whole trip is the harmonic mean of the individual speeds, not the arithmetic mean. Example: 60 km at 30 km/h then 60 km at 60 km/h. Total distance 120 km, total time 2 h + 1 h = 3 h, so the average speed is 40 km/h — which matches the harmonic mean of 30 and 60.
Is the harmonic mean used in finance?
Yes. It is used to average price-to-earnings (P/E) ratios across an equal-weighted portfolio or index, because P/E is itself a ratio of price to a per-unit quantity (earnings). Using the arithmetic mean of P/E ratios systematically overstates the implied multiple. The same logic applies to price-to-book, price-to-sales and other "price per unit of fundamentals" metrics.
What separators can I use to paste a list of numbers?
Commas, spaces, tabs, semicolons or new lines all work, and you can mix them. A column copied straight from a spreadsheet, a comma-separated row, or just numbers separated by spaces all parse correctly. Tokens that are not valid numbers are reported under the result so you can see what was ignored.