Skip to content
Popular Calculators
Browse Statistics calculators

Harmonic Mean Calculator

Find the harmonic mean of positive numbers — the right average for speeds and rates over equal amounts — compared with the other means.

Separate values with commas, spaces or new lines. You can paste a column from a spreadsheet.

About the Harmonic Mean Calculator

Suppose you drive to a town at 60 km/h and back along the same road at 40 km/h. Your average speed for the trip is not 50 km/h — it is 48. The ordinary average gives the wrong answer because you spend longer at the slower speed. The correct average here is the harmonic mean, the right tool whenever you average rates over equal amounts: speeds over equal distances, prices over equal spending, or work rates over equal tasks.

This harmonic mean calculator finds the harmonic mean of any list of positive numbers. It shows the reciprocals used in the calculation, compares the result with the arithmetic and geometric means, and puts it into context as an average speed.

How to Use the Harmonic Mean Calculator

Enter two or more positive numbers, separated by commas, spaces or new lines.

The harmonic mean appears with the reciprocals, a comparison with the other means and an example.

The Formula

  harmonic mean = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ)

  for two values:  H = 2ab ÷ (a + b)

In words: take the reciprocal of each value, find their ordinary average, and take the reciprocal of that. All the values must be positive, because a zero would have no reciprocal.

Step-by-Step Example

Average speed at 60 and 40 km/h over equal distances.

  Reciprocals:  1/60 + 1/40 = 0.016667 + 0.025 = 0.041667
  Mean:         2 ÷ 0.041667 = 48

Check with real distances: 120 km at 60 km/h takes 2 hours, and 120 km at 40 km/h takes 3 hours. That is 240 km in 5 hours, exactly 48 km/h.

The numbers 1, 2 and 4.

  1/1 + 1/2 + 1/4 = 1.75
  3 ÷ 1.75 = 1.71429

For comparison, the arithmetic mean is 2.33 and the geometric mean is 2.

The Three Pythagorean Means

The arithmetic, geometric and harmonic means are known together as the Pythagorean means. For any set of positive numbers they always fall in the same order:

  arithmetic ≥ geometric ≥ harmonic
  for 60 and 40:  50 ≥ 48.99 ≥ 48

They are equal only when all the values are the same, and they spread further apart the more the values differ. Choosing the wrong one gives a systematically wrong answer, so it matters which kind of quantity you are averaging.

When the Harmonic Mean Is Right

Choosing between the means is less about formulas than about the question being asked.

The key question is what stays fixed. If each value is a rate — distance per hour, items per pound, pages per minute — and the numerator is equal for each part, the harmonic mean is correct.

Equal distances at different speeds: harmonic mean of the speeds.

Equal amounts of money at different prices: harmonic mean of the prices gives the average price paid. Spending 100 at 20 per share and 100 at 25 per share buys 5 + 4 = 9 shares for 200, an average of 22.22, the harmonic mean — the basis of the investment idea called pound-cost or dollar-cost averaging.

Equal time at different speeds is different: then the arithmetic mean is right.

Sensitivity to Small Values

Because small numbers have large reciprocals, the harmonic mean is pulled strongly toward the smallest values. A trip with one slow stretch has a low average speed however fast the rest was. This sensitivity is useful in some statistics — the F1 score used to evaluate classifiers is the harmonic mean of precision and recall, so it stays low unless both are good.

Harmonic Mean in Physics and Finance

The same mathematics appears in several other places. Two resistors in parallel have a combined resistance equal to half the harmonic mean of their resistances, and the formula for lenses and springs in series follows the same reciprocal pattern. In finance, the harmonic mean is used to average price-to-earnings ratios across a group of companies, because it gives each company's earnings equal weight and avoids a few very high ratios distorting the result. In every case the pattern is the same: when the quantity being averaged is a rate or a ratio with a fixed numerator, reciprocals are added, and the harmonic mean is the natural average.

Understanding Your Result

The headline is the harmonic mean.

The compared with other means line shows the arithmetic, geometric and harmonic means in order.

The reciprocals line shows the sum of 1/x used in the calculation.

The in context line expresses the result as the average speed of a trip over equal distances.

When Should You Use This Calculator?

Use it to find average speeds over equal distances.

Use it to find the average price paid when investing equal amounts regularly.

Use it for average rates of work, flow or productivity over equal tasks.

Use it for statistics such as the F1 score and in physics formulas for resistors in parallel.

Common Mistakes

Averaging speeds with the ordinary mean. Over equal distances, use the harmonic mean.

Using it over equal times. Equal time periods need the arithmetic mean.

Including zero or negative values. Every value must be positive, because zero has no reciprocal.

Forgetting the final reciprocal. Divide the count by the sum of reciprocals, not the other way round.

Assuming all three means are close. They diverge as the values spread out.

Using unequal amounts. If the distances or amounts differ, use a weighted harmonic mean, weighting each rate by its distance or amount, rather than the plain formula.

Frequently Asked Questions

What is the average speed if I drive at 60 and then 40 km/h over equal distances?

48 km/h, the harmonic mean, not 50. Driving 120 km at each speed takes 2 hours and 3 hours: 240 km in 5 hours is 48 km/h, because more time is spent at the slower speed.

How do I calculate the harmonic mean?

Take the reciprocal of each value, add them, and divide the count by that sum. For 1, 2 and 4: 1 + 0.5 + 0.25 = 1.75, and 3 ÷ 1.75 = 1.71429. All the values must be positive.

How does the harmonic mean compare with the others?

For positive numbers the arithmetic mean is always at least the geometric mean, which is at least the harmonic mean. For 60 and 40 they are 50, 48.9898 and 48, and all three are equal only when every value is the same.

When should I use the harmonic mean?

For averaging rates over equal amounts: speeds over equal distances, prices when spending the same amount each time, or fuel economy over equal distances. It is also used for the F1 score in statistics and machine learning.

Why does one small value affect it so much?

Because a small value has a large reciprocal. The average speed of a trip is dominated by its slowest part, so the harmonic mean sits close to the smallest values, which is exactly what makes it right for rates.

What is an example with prices?

If you spend 100 on shares at 20 each and another 100 at 25 each, you buy 5 and 4 shares, 9 in total for 200. The average price paid is 200 ÷ 9 = 22.22, the harmonic mean of 20 and 25, not 22.50.

Last reviewed September 28, 2026 by the CalculatorPeak editorial team.