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.