Harmonic Mean Calculator

Enter positive values and how many to use. The harmonic mean suits rates over equal distances or equal amounts, like average speed.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

harmonic mean = n ÷ (1/x1 + 1/x2 + ... + 1/xn)

Worked example

Driving to a town at 60 km/h and returning at 40 km/h over the same distance:

  • Sum of reciprocals = 1/60 + 1/40 = 0.041667
  • Harmonic mean = 2 ÷ 0.041667 = 48 km/h
  • The arithmetic mean, 50 km/h, is wrong here because more time is spent at 40.

For 30, 45 and 60: 3 ÷ (1/30 + 1/45 + 1/60) = 41.538.

Frequently asked questions

How do you calculate the harmonic mean?

Divide the count of values by the sum of their reciprocals. For 60 and 40: 2 ÷ (1/60 + 1/40) = 2 ÷ 0.041667 = 48.

How do I find average speed with the harmonic mean?

When each leg covers the same distance, the average speed is the harmonic mean of the leg speeds. Driving one way at 60 and back at 40 gives 48, not 50, because you spend longer at the slower speed.

When should I use the harmonic mean instead of the arithmetic mean?

Use it to average rates when the same quantity is covered at each rate, such as speeds over equal distances or prices per unit when you spend equal money on each. If the time at each rate is equal, use the arithmetic mean.

Why must the values be positive?

A zero value would need 1/0, and mixed signs make the reciprocals cancel and give meaningless results. Every value must be above zero.