Harmonic Mean Calculator
Find the harmonic mean of any data set.
Result
How it is calculated
The harmonic mean of n numbers is H = n / (1/x1 + 1/x2 + … + 1/xn), which is the reciprocal of the average of the reciprocals. Enter the numbers separated by commas, semicolons or spaces; entries that are not numbers are ignored.
Every number must be greater than zero. If any value is zero or negative the tool gives no result, because a reciprocal is undefined at 0 and the mean loses its meaning for mixed signs. The harmonic mean is always at or below the ordinary (arithmetic) mean and is pulled towards the smallest value. It is the right average for rates measured over equal distances or equal amounts, such as speeds, prices per unit and P/E ratios.
Worked example
You drive a route at 40 km/h and drive back over the same distance at 60 km/h. Reciprocals: 1/40 = 0.025 and 1/60 ≈ 0.016667, summing to 0.041667. With 2 values, H = 2 / 0.041667 = 48.00. The correct average speed is 48 km/h. The ordinary average of 50 would be wrong, because you spend more time at the slower speed.
Common mistakes
- Using the ordinary average for speeds over equal distances. For 40 and 60 it gives 50, but the true average speed is 48.
- Including a zero or a negative value, which makes the tool return nothing.
- Applying it to rates over equal times rather than equal distances. In that case the ordinary mean is the correct average.
- Typing a number with a decimal comma (3,5), which is read as two separate numbers 3 and 5.
About this calculator
This calculator computes the harmonic mean, n / Σ(1/xᵢ) — the reciprocal of the average of the reciprocals — which, unlike the arithmetic mean, gives more weight to smaller values and is the mathematically correct way to average rates.
It's the standard tool for averaging speeds over equal distances (e.g., driving 60 km/h there and 40 km/h back doesn't average to 50 km/h — the harmonic mean gives the correct 48 km/h), for finance metrics like the average P/E ratio of a portfolio, and for computing the F1 score in machine learning, which harmonically averages precision and recall. The calculator flags when any input is zero, since the harmonic mean is undefined in that case (division by zero in the reciprocal).
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)