Mihsaba›Math›Harmonic Mean Calculator

Harmonic Mean Calculator

Calculate the harmonic mean for positive rates or values, with geometric and arithmetic means for comparison.

The harmonic mean equals the number of observations divided by the sum of their reciprocals. It suits equal-distance average speeds; enter positive values only.

Try a real worked example
Share this free calculator

Send this tool to someone who needs the calculation.

How to use

The harmonic mean is useful for rates such as speeds over equal distances. It gives smaller values more influence than the arithmetic mean. The harmonic mean formula is H = n ÷ Σ(1/x). For 10, 20 and 30, the reciprocal sum is 11/60, giving H = 180/11 ≈ 16.3636. Driving one hour at 30 and one hour at 60 gives an average speed of 45 because the times are equal; the harmonic mean of 40 applies to equal distances.

  1. Enter positive values.
  2. Combine their reciprocals using a stable scaled form.
  3. Calculate HM and compare it with GM and AM.

How it is calculated

HM=n÷Σ(1/xᵢ)

Example

For speeds 30 and 60 over equal distances: HM = 2÷(1/30+1/60)=40, not 45.

Important notes

If weights or distances are unequal, a weighted harmonic mean may be required; this calculator implements the unweighted form.

Worked examples and interpreting results

For 30 and 60, the harmonic mean is 40 rather than 45. For two equal travel distances at different speeds, it gives the average speed because the slower leg takes longer.

Worked examples and interpreting results
CaseCalculationResult
Harmonic mean2 ÷ (1/30 + 1/60)40
Arithmetic mean for comparison(30 + 60) ÷ 245

How to check the result

The calculator accepts positive values; zero has no defined reciprocal. Do not automatically use a harmonic mean for every rate: equal distances differ from equal times, where the arithmetic mean of speeds applies.

Harmonic mean for equal-distance speeds

The harmonic mean is useful for positive rates, especially average speed over two equal distances. For two values a and b, use 2ab/(a+b). For two equal travel times, the arithmetic mean of the speeds is appropriate instead.

  • 30 and 60 over equal distances: 2 ÷ (1/30 + 1/60) = 40
  • 30 and 60 over equal time intervals: (30 + 60) ÷ 2 = 45
  • Harmonic mean of 10 and 20: 2 × 10 × 20 ÷ (10 + 20) = ≈ 13.3333

Important distinction

Do not use the harmonic mean merely because numbers represent rates. Check whether distances or times are equal. Zero cannot be included because the reciprocal is undefined.

Related calculators

Frequently asked questions

Can zero be included?

No, because 1/0 is undefined.

How do the means compare for positive data?

Generally HM ≤ GM ≤ AM.

Why is the harmonic mean useful for some rates?

For distance-per-time rates measured over equal distances, time is proportional to the reciprocal of the rate, so the harmonic mean combines them correctly. It is not automatically appropriate when the time intervals are equal.

How do I calculate the harmonic mean of two numbers?

For positive a and b, use H = 2ab ÷ (a + b). For 10 and 20, this is 400 ÷ 30 ≈ 13.3333.

What is the harmonic mean of 4 and 12?

The harmonic mean is the number of observations divided by the sum of their reciprocals: HM = 2/(1/4 + 1/12) = 6. The arithmetic mean of the same two values is 8, so the means are not interchangeable.

Why use the harmonic mean for average speed over equal distances?

For two equal-distance legs at 30 km/h and 60 km/h, harmonic mean speed is 2/(1/30 + 1/60) = 40 km/h. It correctly weights the longer time spent at the slower speed. For equal travel times instead, the arithmetic mean of speeds is appropriate.