Harmonic Mean Calculator
The average of rates — speeds, prices per unit, work rates — where the arithmetic mean gives the wrong answer.
The harmonic mean is n divided by the sum of the reciprocals.
How the harmonic mean calculator works
The harmonic mean is n divided by the sum of the reciprocals. It is the correct average whenever the quantities are rates measured against a fixed numerator: travelling 60 km at 30 km/h and 60 km at 60 km/h averages 40 km/h, not 45.
It is always the smallest of the three classical means, and it is dominated by the small values — one very slow leg drags the whole average down.
Formula: HM = n / Σ(1/xᵢ)
Worked examples
| Inputs | Harmonic mean | Note |
|---|---|---|
| 30 and 60 km/h over equal distances | 40 | 40 km/h |
| Three rates | 3 | HM = 3 |
| Identical values | 5 | HM = 5 |
FAQFrequently asked questions
What is the average speed for equal distances?
The harmonic mean. 30 km/h out and 60 km/h back averages 40 km/h, because you spend twice as long on the slow leg.
When is the arithmetic mean right for speeds?
When the *times* are equal rather than the distances. Then it is a plain average.
Why is it always the smallest mean?
Because reciprocals magnify small values, so they dominate the sum.
Where else is it used?
Averaging P/E ratios, price per unit, parallel resistance, and the F₁ score in machine learning — which is the harmonic mean of precision and recall.
Can it take negatives?
Not meaningfully — the reciprocals can cancel and produce nonsense. Use it on positive rates only.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- National curriculum in England — Mathematics — the terms and methods taught in UK schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.