Interactive tool

Harmonic Mean Calculator — Formula, Speed Examples, and Rate Averaging

Harmonic mean (HM) is n divided by the sum of reciprocals: HM = n / (1/x₁ + 1/x₂ + ⋯ + 1/xₙ). It is the correct average when each value is a rate applied over an equal distance, budget, or unit — such as speeds over equal distances or prices per equal spending. Classic example: traveling 100 km at 30 mph and 100 km at 60 mph — the true average speed is HM = 40 mph, not the arithmetic mean of 45 mph.

Client-side

Enter 2 to 30 positive values separated by commas, spaces, or line breaks.

Result Ready
Comparison Ready
Count Ready
Note Ready

Rate & reciprocal average

Before you calculate

Harmonic mean (HM) is n divided by the sum of reciprocals: HM = n / (1/x₁ + 1/x₂ + ⋯ + 1/xₙ). It is the correct average when each value is a rate applied over an equal distance, budget, or unit — such as speeds over equal distances or prices per equal spending. Classic example: traveling 100 km at 30 mph and 100 km at 60 mph — the true average speed is HM = 40 mph, not the arithmetic mean of 45 mph.

Best forSpeeds over equal distances, prices per equal budget, productivity rates per equal workload, and any rate where the denominator (distance, dollars, units) is held constant. InputTwo to 30 positive rates or ratios. All values must be greater than zero. OutputHarmonic mean alongside arithmetic and geometric mean, so you can see the magnitude of the rate-distortion effect.

The reciprocal logic behind harmonic mean

HM is the only average that automatically weights each rate by the time or resource it consumes — without requiring you to calculate those weights manually.

Mechanism

HM inverts so you do not have to

At 30 mph over 100 km, you spend 3.33 hours. At 60 mph over 100 km, you spend 1.67 hours. HM automatically gives 30 mph twice the weight of 60 mph because 1/30 = 0.0333 >> 1/60 = 0.0167. You never have to calculate the time weights manually.

Limit

One very small rate collapses HM

If one rate approaches zero (e.g., a vehicle nearly stopped), HM approaches zero regardless of the other rates. For 1 mph and 60 mph: HM = 2/(1 + 1/60) = 1.97 mph — dominated by the 1 mph leg. This is mathematically correct: a near-stop over equal distance makes the average very low.

Finance

Dollar-cost averaging uses harmonic mean

When you invest the same dollar amount each month at different prices, your average cost per unit is the harmonic mean of the prices. Example: invest $100 at $10/share (10 shares) and $100 at $20/share (5 shares) → average cost = $200 / 15 shares = $13.33/share = HM of $10 and $20.

HM versus AM: four situations where the choice matters

Getting the wrong mean here produces a numerically wrong answer — not just a different perspective.

Situation Input Best next move Why
Round trip at two different speeds 100 km at 30 mph, 100 km at 60 mph HM = 40 mph → 5 hours total AM = 45 mph would predict 4.44 hours — 33 minutes faster than the real trip.
Driving at two speeds for equal time 30 mph for 1 hour, 60 mph for 1 hour AM = 45 mph → 90 km total Equal time, not equal distance: AM is correct here. HM = 40 would be wrong.
Dollar-cost averaging $100 at $10/share; $100 at $20/share HM = $13.33/share (15 total shares) AM of $15 would imply 13.3 shares at $15 = $200, but actual shares purchased = 15.
P/E ratio comparison across companies P/E ratios: 15, 20, 25 Use GM → 19.57 (ratio scale) P/E is a ratio, not a rate over equal denominator — geometric mean is more appropriate.

Step-by-step: how to use this calculator correctly

01

Confirm the rates you are averaging apply over an equal denominator: equal distance, equal budget, or equal quantity — not equal time.

02

Enter only positive values. Zero is invalid because the formula uses 1/xᵢ, and 1/0 is undefined.

03

Read HM as the correct equal-unit average. If HM is much lower than AM, a high rate is inflating the arithmetic result.

04

Check: if HM = AM for your data, all rates are identical. If HM << AM, a very large rate is dominating the arithmetic mean.

Round-trip speed: why HM = 40 mph, not 45 mph

Given

A car drives 100 km to a destination at 30 mph and returns 100 km at 60 mph.

Work

HM = 2 / (1/30 + 1/60) = 2 / 0.05 = 40 mph. Travel time: 100/30 + 100/60 = 3.33 + 1.67 = 5 hrs. Average = 200 km / 5 hrs = 40 mph. AM of 45 mph would predict 200/45 = 4.44 hrs — 33 minutes too short.

Result

True average speed = 40 mph (harmonic mean). Arithmetic mean of 45 mph overstates speed and underestimates travel time by 33 minutes.

Takeaway

Use HM whenever the same distance or unit is covered at each rate. Using AM for equal-distance speed averaging always overestimates the average speed.

Harmonic mean versus other rate averages: which is correct?

HM is correct when the denominator (distance, budget, quantity) is equal for each rate. A different method applies when the numerator (time, output) is equal instead.

Method Best for Watch for Example
Harmonic mean Equal-denominator rates: speeds over equal distances, prices per equal budget, efficiency per equal workload. All inputs must be positive. Zero makes the formula undefined (1/0). 30 mph and 60 mph over equal distance → HM = 40 mph. Travel time = 200 km / 40 mph = 5 hours ✓.
Arithmetic mean Equal-numerator rates: speeds observed for equal time, outputs measured over equal time. Wrong for equal-distance speed problems. AM = 45 mph implies 200 km / 45 = 4.44 hrs — 33 minutes too short. 30 mph for 1 hr and 60 mph for 1 hr → AM = 45 mph is correct (total = 90 km in 2 hrs).
Geometric mean Ratios and growth factors that multiply: P/E ratios, fold changes, normalized benchmarks. Does not directly answer rate-per-equal-distance questions. P/E ratios 15 and 25 → GM = 19.36 (the fair midpoint on a ratio scale).
Weighted mean Rates with unequal denominators: different distances, different budgets, different quantities. Weights must accurately reflect the real denominator for each observation. 60 mph for 120 km and 30 mph for 60 km → weighted by distance gives 50 mph.

HM = 40, GM = 42.43, AM = 45 — three different answers for 30 mph and 60 mph

All three means use 30 and 60 as inputs but answer different questions. Only HM = 40 correctly predicts the round-trip travel time when both legs cover equal distance.

HM
40
GM
42.43
AM
45

Harmonic mean calculation flow: invert, sum, invert again

HM = n / (1/x₁ + 1/x₂ + ⋯ + 1/xₙ). For 30 and 60: HM = 2 / (0.0333 + 0.0167) = 2 / 0.05 = 40.

01 Invert

Compute 1/xᵢ for each rate: 1/30 = 0.0333, 1/60 = 0.0167.

02 Sum

Add the reciprocals: 0.0333 + 0.0167 = 0.05.

03 Divide

Divide n by the reciprocal sum: 2 / 0.05 = 40.

04 Verify

Check: total distance / HM = expected time? 200 km / 40 mph = 5 hrs = 100/30 + 100/60 ✓.

Key facts before you calculate

The equal-denominator rule: when to use harmonic mean

Use HM when the denominator of the rate is fixed for each observation. Speeds over equal distances: use HM. Prices per equal dollar spent: use HM (if you spend $100 at $2.50/unit and $100 at $5.00/unit, you buy 40 + 20 = 60 units, average price = $200/60 = $3.33/unit = HM). Speeds over equal time: use AM (30 mph for 1 hour and 60 mph for 1 hour → AM = 45 mph is correct, because total distance = 90 km in 2 hours).

HM ≤ GM ≤ AM: what the ordering means for your data

For any set of positive values that are not all equal, HM < GM < AM. For 30 and 60: HM = 40, GM = 42.43, AM = 45. The 5 mph gap between HM and AM is not an error — it is the correct difference between the equal-distance rate (HM) and the equal-time rate (AM). The gap grows larger as the ratio between the fastest and slowest rate increases.

Three harmonic mean errors that produce wrong travel times and costs

All three mistakes produce answers that look plausible but are numerically incorrect for equal-denominator rate problems.

Watch for

Using arithmetic mean for equal-distance speeds

AM = 45 mph for {30, 60} over equal distance. Actual trip = 5 hours. AM predicts 4.44 hours — 33 minutes too short. Use HM = 40 mph.

Watch for

Entering a zero rate

Zero makes 1/0 undefined. If a vehicle is stationary for part of an equal-distance leg, the average speed for that leg is undefined — rethink how the distance is segmented.

Watch for

Using HM when time intervals are equal (not distances)

Driving 30 mph and 60 mph for 1 hour each: AM = 45 mph is correct. HM = 40 mph is wrong here — total distance = 90 km in 2 hours = 45 km/hr average.

Keep going

Continue with the Statistics hub, compare this result against a related method, or open a guide that covers the same data pattern in more depth.

HubStatistics Calculators: Arithmetic, Weighted, Geometric, and Harmonic Mean

The three Pythagorean means — arithmetic, geometric, and harmonic — each answer a different averaging question. Arithmetic mean sums values; geometric mean multiplies them; harmonic mean uses reciprocals for rates. This hub links to each calculator, explains which one fits your data, and shows Excel equivalents for each formula.

Additive averageArithmetic Mean Calculator — Formula, Examples, and When to Use It

Arithmetic mean (AM) is the sum of all values divided by the count: AM = (x₁ + x₂ + ⋯ + xₙ) / n. It is the correct average when every value contributes equally to a total — such as test scores, temperatures, and counts. This calculator computes AM alongside geometric and harmonic mean so you can confirm which average best fits your data.

Unequal-importance averageWeighted Mean Calculator - Values, Weights, Formula, and Examples

Weighted mean is the correct average when each value does not count equally. Formula: weighted mean = sum(value x weight) / sum(weight). Use it for course grades with different credit weights, portfolio returns with different capital allocations, survey results with sample weights, and prices with different quantities. This calculator returns weighted mean, arithmetic mean, total weight, and weighted sum so you can see how much the weights changed the result.

Spread & dispersionVariance and Standard Deviation Calculator — Population vs Sample Formula

Variance measures the average squared distance of each value from the mean. Standard deviation is its square root — bringing the result back to the original unit. Population variance divides by n; sample variance divides by n − 1 (Bessel's correction). For dataset {4, 7, 13, 16, 20}: mean = 12, population variance = 34.8, population standard deviation = 5.90. This calculator returns both population and sample versions side by side.

ComparisonGeometric Mean vs Arithmetic Mean: Which Average Is Correct?

Arithmetic mean (AM = sum/n) is correct for additive values. Geometric mean (GM = nth root of product) is correct when values multiply or compound. For scores 72, 80, 88, 96: AM = 84 (correct). For annual return factors 1.06, 0.92, 1.15: GM = 1.038 = 3.8%/yr (correct) — AM of 1.043 overstates by 0.5 pp and compounds to the wrong ending value.

ComparisonGeometric Mean vs Harmonic Mean: Factors vs Rates

Geometric mean (GM) is correct when values multiply: growth factors, fold changes, index relatives. Harmonic mean (HM) is correct when rates share an equal denominator: equal-distance speeds, equal-budget prices per unit. For 30 mph and 60 mph over equal distance: HM = 40 mph (correct travel time), GM = 42.43 mph (wrong), AM = 45 mph (wrong by 33 minutes per 200 km).

ComparisonMean, Median, Mode, and Range: When to Use Each

Mean is the arithmetic average (sum/n). Median is the middle value when sorted. Mode is the most frequent value. Range = max − min. For {30k, 34k, 35k, 38k, 200k}: mean = $67.4k (pulled up by outlier), median = $35k (representative of typical), mode = none, range = $170k. Reporting mean alone for skewed income data overstates the typical salary by 93%.

ComparisonWhich Average Should I Use? AM, GM, HM, Median, or Mode

Arithmetic mean (AM) is correct for additive values: scores 72+80+88+96 → AM = 84. Geometric mean (GM) is correct for multiplicative values: growth factors 1.06×0.65×1.10 → GM = 0.9144 = −8.56%/yr. Harmonic mean (HM) is correct for equal-denominator rates: 30 mph and 60 mph over equal distance → HM = 40 mph. Median is correct for skewed data: incomes {$30k,$34k,$35k,$38k,$200k} → median = $35k (mean = $67.4k is 93% too high). Mode is correct for categories: survey {A,B,B,C,B,A} → mode = B.

Frequently asked questions

Can harmonic mean use zero or negative values?

No. The formula requires 1/xᵢ for each value. Dividing by zero is undefined, and negative rates (e.g., a negative speed) have no physical meaning in ordinary rate-averaging. Remove any zero entries or rethink the rate definition.

Why is harmonic mean lower than arithmetic mean for the same rates?

Because HM weights slower rates more heavily — a slower rate takes proportionally more time or resource per unit than a faster rate. For 30 mph and 60 mph: the car spends twice as long at 30 mph as at 60 mph on an equal-distance trip, so 30 mph dominates the true average. HM = 40 correctly reflects that dominance; AM = 45 does not.

Why is harmonic mean always lower than arithmetic mean?

By the AM-HM inequality, HM ≤ AM for all positive values (equal only when all values are the same). For {30, 60}: HM = 40, AM = 45. The gap exists because HM weights slower rates more heavily — 30 mph gets twice the reciprocal weight of 60 mph.

Can harmonic mean be used for percentage changes or returns?

Not for compounding returns — use geometric mean. HM is appropriate when percentages represent rates over equal spending units, such as dollar-cost averaging. If you invest the same $ amount each period at different prices, your average unit cost is the harmonic mean of the prices.

What happens to HM when one rate is very large?

A very large rate has a very small reciprocal (1/1000 = 0.001), so it barely affects the reciprocal sum. HM stays close to the average of the smaller rates. Example: HM of 10 and 1,000 = 2 / (0.1 + 0.001) = 19.8 — close to 20, not 505.