Skip to content

Harmonic Mean Calculator — Step-by-Step Solutions

The Harmonic Mean Calculator computes the reciprocal-based average, which is especially useful for averaging rates, speeds, and ratios. It gives less weight to large outliers compared to the arithmetic mean.

Enter a dataset to calculate the harmonic mean, provide value-weight pairs for a weighted harmonic mean, or compare all three Pythagorean means (arithmetic, geometric, harmonic) to see the AM-GM-HM inequality in action.

0 values detected

Your calculations will appear here

How to Use the Harmonic Mean

  1. Harmonic Mean: enter non-zero numbers separated by commas. The result shows the harmonic mean, the sum of reciprocals and the count.
  2. Weighted HM: enter one pair per line, as value, weight (for example 40, 2). Use it when the values apply to different amounts, such as speeds over different distances.
  3. Compare All Means: enter positive numbers to see the arithmetic, geometric and harmonic means side by side and check that HM <= GM <= AM.
  4. The harmonic mean is not defined when any value is zero, and the comparison mode needs all values above zero.

Formula and Theory

The harmonic mean is the reciprocal of the average of the reciprocals: HM = n / (1/x1 + 1/x2 + ... + 1/xn). It is the correct average for rates when the same amount of the underlying quantity is covered at each rate, for instance average speed over equal distances, or price-earnings ratios across equal investments.

The reason is that rates are quantities divided by something. If you drive 60 km at 40 km/h and 60 km at 60 km/h, the times are different, so the arithmetic mean of 40 and 60 overstates the true average speed. The harmonic mean gives the total distance divided by the total time.

For unequal amounts, weight each rate by the amount it applies to: WHM = (sum of weights) / (sum of weight / value). With weights as distances, this gives the true overall average speed.

For positive numbers HM <= GM <= AM, with equality only when all values are equal. The harmonic mean is pulled towards the smallest values, which makes it the most conservative of the three.

Worked Examples

Example 1: Average speed over equal distances

Problem: You drive to a town at 40 km/h and return at 60 km/h over the same road. What is your average speed for the round trip?

Solution: Equal distances means a harmonic mean. HM = 2 / (1/40 + 1/60) = 2 / 0.041667 = 48. Check with distance: for a 120 km one-way trip, the times are 3 hours and 2 hours, so 240 km in 5 hours = 48 km/h.

Answer: 48 km/h (not 50)

Example 2: Equal distances at 30 and 60

Problem: Find the harmonic mean of 30 and 60.

Solution: HM = 2 / (1/30 + 1/60) = 2 / (2/60 + 1/60) = 2 / (3/60) = 2 x 20 = 40.

Answer: 40

Example 3: Weighted harmonic mean

Problem: You cover 2 units of distance at 40, 3 units at 60 and 5 units at 80. What is the overall average speed?

Solution: Total weight = 2 + 3 + 5 = 10. Weighted reciprocal sum = 2/40 + 3/60 + 5/80 = 0.05 + 0.05 + 0.0625 = 0.1625. WHM = 10 / 0.1625 = 61.538.

Answer: 61.54

Example 4: Comparing the three means

Problem: Compare the means of 1, 4, 4.

Solution: AM = 9 / 3 = 3. GM = (1 x 4 x 4)^(1/3) = 16^(1/3) = 2.5198. HM = 3 / (1 + 0.25 + 0.25) = 3 / 1.5 = 2.

Answer: AM 3, GM 2.5198, HM 2

Frequently Asked Questions

When do I use the harmonic mean?
Use it to average rates or ratios over equal amounts of the denominator: speeds over equal distances, prices per unit when you spend the same money on each, or fuel efficiency over equal distances.
Why is the average speed not just the average of the two speeds?
Because you spend more time at the slower speed. Time is distance divided by speed, so the slower leg weighs more heavily in the overall average, and the harmonic mean accounts for that.
Why can the harmonic mean not include zero?
It uses 1/x, which is undefined at zero. A zero rate would also mean the journey never finishes.
What is the relationship between AM, GM and HM?
For positive numbers HM <= GM <= AM. The three are equal only when every value is the same. For two numbers, GM squared equals AM times HM.
What do the weights mean in the weighted version?
Each weight is the amount that goes with its value, such as the distance covered at that speed. Use the same units for all weights.
Does it work with negative values?
It will calculate if no value is zero, but mixed signs make the result hard to interpret. It is normally used with positive quantities.

Related Statistics Calculators

Related Articles