Harmonic Mean Calculator
Free harmonic mean calculator: enter positive values to get n divided by the sum of reciprocals, with steps and the AM-GM-HM comparison shown.
About the Harmonic Mean Calculator
The harmonic mean of n positive values is n divided by the sum of their reciprocals: HM = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ). It is the right average for rates measured over equal quantities — average speed over equal distances, price-to-earnings ratios, machines' rates of work. This free harmonic mean calculator parses comma-, space- or newline-separated values and shows the reciprocal-sum working step by step.
It also displays the geometric and arithmetic means so you can see the classic inequality HM ≤ GM ≤ AM in action. The textbook example: drive somewhere at 60 km/h and return at 40 km/h and your true average speed is not 50 but the harmonic mean, 48 km/h. Statistics students and finance analysts alike will find both the answer and the working here.
How to Use the Harmonic Mean Calculator
- 1Enter your positive values, separated by commas, spaces or new lines.
- 2Read the harmonic mean with the reciprocal-sum steps.
- 3Compare with the geometric and arithmetic means shown alongside.
Frequently Asked Questions
How is the harmonic mean calculated with an example?
HM = n ÷ Σ(1/x). For 60 and 40: 2 ÷ (1/60 + 1/40) = 2 ÷ (0.01667 + 0.025) = 2 ÷ 0.04167 = 48. The arithmetic mean of the same values is 50 and the geometric mean is 48.99 — HM is always the smallest of the three.
Why is the harmonic mean correct for average speed?
Because equal distances take unequal times. Driving 120 km at 60 km/h takes 2 h; returning at 40 km/h takes 3 h. Total: 240 km in 5 h = 48 km/h — exactly the harmonic mean, not the arithmetic 50. If instead you spend equal times at each speed, the arithmetic mean is correct.
Where is the harmonic mean used in finance?
Averaging ratios like P/E across a portfolio weighted by investment amount. Equal money in two stocks with P/E 10 and 30 has a portfolio P/E of 2 ÷ (1/10 + 1/30) = 15, not the arithmetic 20. It also underlies the average cost in rupee/dollar-cost averaging.
Why can't the harmonic mean handle zeros or negatives?
The reciprocal of 0 is undefined (division by zero), and mixing negative reciprocals can make the denominator zero or flip the result's meaning. That is why this calculator requires all values to be strictly positive and explains the issue instead of returning NaN.