🏆 US-Registered Digital Marketing Agency Trusted by 200+ brands · USA · UK · Canada · AUS
Advertisement
Advertisement
STATISTICS

Harmonic Mean Calculator — the average for rates

The correct average for speeds, rates and ratios, with the reciprocal working shown.

Commas, spaces or new lines. No value may be zero — its reciprocal is undefined.
For journeys with unequal legs, weight each speed by the distance covered at it.
Harmonic mean
0
 
0
Sum of reciprocals
0
Number of values
0
Arithmetic mean
0
Geometric mean
Working:  
Tip: for positive numbers the order never changes — harmonic mean ≤ geometric mean ≤ arithmetic mean, with equality only when all values are identical.
Advertisement

The harmonic mean calculator above divides the count of your values by the sum of their reciprocals. Like the geometric mean, it exists because there is a specific family of data for which the ordinary arithmetic average is not just different but wrong: rates. Speeds, prices per unit, work rates, cost per acquisition, throughput — anything expressed as one quantity per another quantity — needs the harmonic mean whenever the denominator is what stays fixed across the things you are averaging.

Our mean, median and mode calculator handles the arithmetic mean, and for most data that is the right tool. Our geometric mean calculator handles growth rates that compound. This page covers the third case. Arb Digital keeps them separate because choosing between the three is the entire skill; the arithmetic on each is trivial once the choice is made.

What This Harmonic Mean Calculator Does

Enter a series of non-zero values and the calculator returns the harmonic mean, the sum of the reciprocals used to get there, the count, and both the arithmetic and geometric means for direct comparison. The working panel prints the substituted formula with your own numbers, showing each reciprocal rather than jumping to the answer.

Weighted mode covers the case that catches people out. The plain harmonic mean assumes every value applies over an equal amount of the underlying quantity — equal distances, equal quantities purchased, equal units of work. When those amounts differ, each value must be weighted by the amount it applies to, and the calculator switches to the weighted harmonic mean formula automatically.

A value of zero makes the calculation impossible, because its reciprocal is undefined, and the tool says so rather than substituting something misleading. Mixing positive and negative values is also flagged: reciprocals of opposite signs can cancel and produce a sum near zero, which sends the harmonic mean to an enormous or nonsensical figure. In practice, harmonic means are used almost exclusively on strictly positive data.

How to Use It

  1. Enter your rates in their natural units — miles per hour, dollars per unit, tasks per hour. Do not convert them to reciprocals yourself.
  2. Decide whether the legs are equal. Equal distances, equal quantities or equal batches mean you can leave weighting on equal.
  3. Switch to weighted mode if the amounts differ, and enter the amount each rate applied to as its weight.
  4. Read the working line to see each reciprocal and the division that produced the result.
  5. Compare with the arithmetic mean in the grid. The gap is how far the wrong average would have taken you.

The Formula and How It's Calculated

The formula is HM = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ). Take the reciprocal of every value, add them, and divide the count by that total.

Take the default series of 60, 40 and 30, representing three equal legs of a journey driven at those speeds. The reciprocals are 1/60 = 0.016667, 1/40 = 0.025 and 1/30 = 0.033333, which sum to 0.075. Dividing the count by that sum gives 3 ÷ 0.075 = 40. The average speed over the whole journey is 40, not the 43.33 that the arithmetic mean of (60 + 40 + 30) ÷ 3 suggests.

Confirm it with real distances. Suppose each leg is 120 units long, so the total is 360. The legs take 120/60 = 2, 120/40 = 3 and 120/30 = 4 units of time, totalling 9. Average speed is total distance divided by total time: 360 ÷ 9 = 40, exactly matching the harmonic mean. The arithmetic mean of 43.33 corresponds to no real journey at all. The formal definition and its relationship to the other Pythagorean means is given in MathWorld's entry on the harmonic mean.

Advertisement

The Rule That Tells You Which Mean to Use

The harmonic, geometric and arithmetic means are collectively known as the Pythagorean means, and choosing between them comes down to one question. Every rate is a fraction with something on top and something on the bottom. Speed is distance over time. Price per unit is cost over units. Cost per acquisition is spend over conversions. The rule is this: hold the numerator constant and use the arithmetic mean; hold the denominator constant and use the harmonic mean.

Work through both directions with speed. If you drive for equal amounts of time at 60 and 40 — the denominator, time, is fixed — the arithmetic mean of 50 is correct, because you cover 60 units in the first hour and 40 in the second, 100 units in two hours. If you drive equal distances at 60 and 40 — the numerator, distance, is fixed — the harmonic mean of 48 is correct, because the slow leg takes longer and therefore occupies more of the journey. Same two numbers, two different correct answers, decided entirely by which part is held constant.

That is why the harmonic mean is always the smaller of the two: the slower rate consumes more of the fixed quantity, so it deserves more influence, and the harmonic mean gives it exactly that automatically. The arithmetic mean treats both legs equally and consequently flatters the result.

Where This Costs Real Money

Advertising cost metrics are a textbook case. If one campaign spends $1,000 at a $10 cost per acquisition and another spends $1,000 at a $50 cost per acquisition, the blended figure is not the arithmetic average of $30. The first delivers 100 acquisitions and the second 20, so the true blended cost is $2,000 ÷ 120 = $16.67 — which is exactly the harmonic mean of 10 and 50 when spend is equal across both. Reporting $30 would nearly double the real cost and could kill a campaign that is actually performing.

The same structure appears in price averaging. Spend a fixed $600 per month on a stock priced at $60, then $40, then $30, and your average purchase price is the harmonic mean of 40, not the arithmetic mean of 43.33, because the fixed dollar amount buys more shares when the price is low. That is the mathematical engine behind pooled purchasing, which our dollar cost averaging calculator and stock average calculator model directly. If instead you buy a fixed number of shares each time, the denominator is no longer fixed and the arithmetic mean becomes correct — the distinction is worth checking before you quote an average price.

The F1 Score and Other Balanced Ratios

The harmonic mean has a second personality in statistics and machine learning, where it is used to combine two ratios so that neither can be gamed. The F1 score is the harmonic mean of precision and recall, chosen specifically because the harmonic mean punishes imbalance far more harshly than the arithmetic one.

The numbers show why. A model with precision 1.0 and recall 0.0 has an arithmetic mean of 0.5, which sounds like a passable result for something that is in fact completely useless. Its harmonic mean is 0, correctly reporting failure. A balanced model at 0.5 and 0.5 also has an arithmetic mean of 0.5 but a harmonic mean of 0.5 as well. Whenever you need a summary that cannot be inflated by maxing one component and abandoning the other, the harmonic mean is the tool, which is also why it appears in composite scores and in ratios such as those in our LTV to CAC ratio calculator.

Weighted Harmonic Means and Unequal Legs

The plain formula quietly assumes each rate applies over an equal share of the fixed quantity. Real journeys and real purchases rarely cooperate. If you drive 300 miles at 60 and 100 miles at 40, the correct average is the weighted harmonic mean, weighting each speed by its distance: (300 + 100) ÷ (300/60 + 100/40) = 400 ÷ (5 + 2.5) = 400 ÷ 7.5 = 53.33.

Note how far that sits from the unweighted harmonic mean of 48, and from the arithmetic mean of 50. The weight matters as much as the choice of mean. The general principle is the same as with any weighted average: the weight should be the amount of the fixed quantity that each rate applied to. Our weighted average calculator handles the additive version of the same idea.

Want more free statistics tools?

Arb Digital maintains a free library of maths, statistics and marketing calculators. Browse the collection, or tell us which one would save you time.

Browse All Free Tools Suggest a Tool

Common Mistakes to Avoid

  • Averaging speeds arithmetically over equal distances. The slower leg takes more time, so it must carry more influence. The harmonic mean does that automatically.
  • Blending cost-per-acquisition figures as a simple average. With equal spend, the correct blend is the harmonic mean, which is always lower than the arithmetic one.
  • Using equal weighting on unequal legs. If the distances, quantities or spends differ, switch to the weighted formula or the answer will be wrong.
  • Including a zero. A reciprocal of zero is undefined, so a single zero value makes the harmonic mean impossible to compute.
  • Mixing positive and negative values. Opposite-signed reciprocals can cancel, driving the denominator toward zero and producing a meaningless result.

Related Free Tools From Arb Digital

For additive data use the mean, median and mode calculator, and for compounding growth use the geometric mean calculator. When some values deserve more influence in an additive setting, use the weighted average calculator. For fixed-budget purchasing, the dollar cost averaging calculator and stock average calculator apply this maths directly, and the CPA calculator works out the cost per acquisition figures you might blend. Browse the full free online tools hub for more.

Frequently Asked Questions

What is the harmonic mean?

The harmonic mean is the number of values divided by the sum of their reciprocals. For 60, 40 and 30 the reciprocals sum to 0.075, and dividing 3 by 0.075 gives a harmonic mean of 40.

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

Use it when averaging rates where the denominator of the rate is what stays fixed, such as speeds over equal distances or costs per acquisition at equal spend. Use the arithmetic mean when the numerator is fixed instead.

How do you find the average speed for a round trip?

Take the harmonic mean of the two speeds, because each direction covers the same distance and the slower leg takes more time. Travelling at 60 one way and 40 back gives an average of 48, not 50.

Why is the harmonic mean always the smallest average?

Because taking reciprocals gives small values a disproportionately large influence on the total. For any set of positive numbers the harmonic mean is at most the geometric mean, which is at most the arithmetic mean, with equality only when all values are identical.

Can the harmonic mean handle a zero?

No. The reciprocal of zero is undefined, so a single zero makes the calculation impossible. Remove or correct the zero entry before computing a harmonic mean.

What is a weighted harmonic mean?

It weights each rate by the amount of the fixed quantity it applied to. Driving 300 miles at 60 and 100 miles at 40 gives 400 divided by the sum of 300 over 60 and 100 over 40, which is 400 divided by 7.5, or 53.33.

Why is the F1 score a harmonic mean?

Because it penalises imbalance. A model with perfect precision and zero recall averages 0.5 arithmetically but scores 0 on the harmonic mean, which correctly reflects that a result strong in one dimension and absent in the other is not useful.

The examples on this page illustrate how averages are calculated. They are general information about arithmetic, not investment or financial advice.

Advertisement
Advertisement

Take it further

Arb Digital assistant

👋 Hey! Want to grow your business? Ask me anything — a free marketing proposal is on the table!