How to calculate the harmonic mean
The harmonic mean divides the number of values by the sum of their reciprocals. For 1, 2, 4 the reciprocals are 1, 0.5, 0.25 (sum 1.75) and there are 3 values, so the harmonic mean is 3 ÷ 1.75 ≈ 1.71. It is always the smallest of the three Pythagorean means.
Working in reciprocals is what makes it suited to rates. A rate such as kilometres per hour inverts to hours per kilometre; averaging those and flipping back gives the true overall rate. It is always the smallest of the three classic means, so compare it with the arithmetic mean from the average calculator.
How to use this calculator
Enter up to four positive numbers and leave unused fields blank. All values must be greater than zero because the harmonic mean uses reciprocals. For multiplicative data, compare with the geometric mean calculator.
The badge shows the count and the reciprocal sum so you can check the arithmetic. Because reciprocals magnify small numbers, one value near zero can dominate the whole result. Negative numbers are rejected, since mixing signs can make the reciprocal sum land on zero.
When to use the harmonic mean
The harmonic mean is best for averaging rates over a fixed quantity, such as average speed over equal distances or price-to-earnings ratios. For an importance-weighted average instead, see the weighted average calculator.
The test is what stays constant: if each rate applies over the same distance or quantity, use the harmonic mean; if each applies over the same amount of time, the arithmetic mean is correct.
Frequently asked questions
- How do I calculate the harmonic mean?
- Divide the count of values by the sum of their reciprocals. For 1, 2, 4 the harmonic mean is about 1.71.
- Why can't I use zero?
- The harmonic mean takes the reciprocal of each value, and dividing by zero is undefined, so all values must be positive.
- How does it compare to other means?
- For the same positive data, the harmonic mean is the smallest, the geometric mean is in the middle, and the arithmetic mean is the largest.
- When is the harmonic mean useful?
- Use it to average rates over equal amounts, such as average speed across legs of the same distance.
- Why does averaging two speeds the ordinary way give the wrong answer?
- Because you spend more time at the slower speed, so it deserves more weight. Driving out at 60 km/h and back at 30 km/h over the same distance gives an average of 40 km/h, the harmonic mean, not the 45 km/h an arithmetic average suggests.