Calculators
Home › Calculators › Harmonic Mean

Harmonic Mean Calculator

Averaging speeds or rates? This is the mean that gets them right.

Calculate the harmonic mean

Harmonic, geometric and arithmetic means of the same data, side by side.

Quick answer: Harmonic mean = n ÷ Σ(1/x). Average speed over equal distances is a harmonic mean: 30 and 60 km/h average to 40, not 45.

How to use this harmonic mean calculator

Enter positive numbers above and press Calculate. The harmonic mean appears with the arithmetic and geometric means for the same data, so the famous ordering (harmonic ≤ geometric ≤ arithmetic) is on display.

The right average for rates

Average speed is the harmonic mean's home turf. Drive 60 km at 30 km/h, then 60 km at 60 km/h, and your average speed is not 45. You spent 2 hours on the slow leg and 1 on the fast: 120 km in 3 hours = 40 km/h. Rates with a fixed numerator (same distance, same investment) must be averaged harmonically, because the slow rate gets more time in your journey, and the formula knows it.

Harmonic mean = n ⁄ Σ(1 ⁄ xi)
Worked example

The two speeds: n = 2, reciprocals 1/30 and 1/60 sum to 0.05, so HM = 2 ÷ 0.05 = 40 km/h, matching the journey exactly. The arithmetic mean's 45 would predict a 2-hour-40-minute trip; reality took 3 hours.

Where else it rules

Average price-earnings ratios, fuel economy over equal distances, parallel resistances in electronics, and the F1 score in machine learning (the harmonic mean of precision and recall, chosen precisely because it punishes a model that neglects either). Whenever the quantity is "per something" and the somethings are equal, reach for the harmonic mean.

Frequently asked questions

When is the harmonic mean used?

For averaging rates and ratios measured against equal amounts of the denominator: speeds over equal distances, prices per unit over equal spending, parallel resistances.

Why is the harmonic mean always the smallest?

For positive values, harmonic ≤ geometric ≤ arithmetic mean (the AM–GM–HM inequality), with equality only when all values are identical. The harmonic mean is dragged down by small values just as the arithmetic mean is dragged up by large ones.

Can the harmonic mean handle zero?

No. A single zero makes its reciprocal undefined. Values must be positive.