Harmonic Mean Calculator
Type or paste positive numbers to get their harmonic mean. The result updates as you type.
Separate with commas, spaces or new lines
What you can type:
- Lists:
4, 7 10; 12is four numbers. Commas, spaces, new lines, tabs and semicolons all separate numbers. - Pasted columns:
4 ↵ 7 ↵ 10pasted as a column from Excel, Google Sheets or a CSV file is three numbers. - Fractions:
7/10, 3/4is 0.7 and 0.75. Write a mixed number such as 1 1/2 as 3/2 or 1.5. - Decimal commas:
1,5; 2,5is 1.5 and 2.5. A comma is read as a decimal comma when the numbers are separated by spaces, semicolons or new lines and none uses a decimal point. - Thousands:
1,200, 1,500is 1200 and 1500. Commas before groups of three digits are thousands separators when the numbers are also separated some other way. - Percent and currency signs:
12%, $40, €3.50is 12, 40 and 3.5. - Exponents and minus signs:
1e3, −4is 1000 and -4. - Anything else:
Score: 4, 7reads 4 and 7 and names “Score:” as ignored. Words, a header row or a date are never dropped silently: the line under the field names everything that was ignored.
↵ is a new line and ⇥ a tab.
6 values
Values used: 4, 7, 10, 8, 5, 9
4, 7, 10, 8, 5, 9
Harmonic mean 6.4588, 6 values.
Worked example for 4, 7, 10, 8, 5, 9.
Harmonic mean 6.4588
- Arithmetic mean
- 7.1667
- Geometric mean
- 6.822
- Minimum
- 4
- Maximum
- 10
- Count
- 6
Show the steps
In the steps, “=” marks a result that is exact for the numbers shown, “≈” a rounded one.
- Add the reciprocals: 1/4 + 1/7 + 1/10 + 1/8 + 1/5 + 1/9 ≈ 0.928968
- Count the values: 6
- Divide the count by that sum: 6 ÷ 0.928968 ≈ 6.4588
Harmonic mean formula
harmonic mean = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ)
The harmonic mean is the number of values divided by the sum of their reciprocals.
How to calculate the harmonic mean, for a drive to a town at 40 km/h and back along the same road at 60 km/h:
- Take the reciprocal of each value, 1 divided by the value: 1/40 and 1/60.
- Add the reciprocals: 1/40 + 1/60 = 3/120 + 2/120 = 5/120 = 1/24.
- Divide the number of values by that sum: 2 ÷ (1/24) = 48 km/h.
Example: average speed
The drive in the formula above, out at 40 km/h and back at 60 km/h, averages 48 km/h for the round trip, not 50, because the slower leg takes more time. Say the town is 120 km away:
- Out at 40 km/h, back at 60 km/h: 240 km in 5 hours
- 48 km/h all the way: the same 5 hours
- 50 km/h all the way: back after 4.8 hours, too soon
Example: average price per unit
You spend $60 on fuel at $2 a gallon and another $60 at $3 a gallon:
- The gallons you bought: 60 ÷ 2 = 30 and 60 ÷ 3 = 20, so 50 in all.
- The average price: $120 ÷ 50 = $2.40 a gallon.
- That is the harmonic mean of 2 and 3: 2 ÷ (1/2 + 1/3) = 2 ÷ (5/6) = 2.4, not the arithmetic mean of $2.50.
When to use the harmonic mean
- Speed and travel: average speed over legs of equal distance.
- Production: average output rate when each machine or worker makes the same number of units.
- Prices: average price per unit when you spend the same amount each time.
- Finance: averaging ratios such as price-to-earnings for equal amounts invested.
If the distances or amounts are not equal, weight each rate by its distance or amount (a weighted harmonic mean), or simply divide the total distance by the total time.
Harmonic mean vs arithmetic mean vs geometric mean
The harmonic mean is pulled towards the smallest values, which is exactly right for rates: the slow leg of a journey takes the most time. The chart in the calculator marks all three means for your numbers; for speeds of 40 and 60 over equal distances:
| Mean | Worked out | Result |
|---|---|---|
| Arithmetic mean | (40 + 60) ÷ 2 | 50 |
| Geometric mean | √(40 × 60) | 48.9898 |
| Harmonic mean | 2 ÷ (1/40 + 1/60) | 48 |
Only the harmonic mean, 48 km/h, is the true average speed for the round trip. See how to choose the right mean for a side-by-side comparison.
Related calculators
For ordinary averages use the mean calculator; for growth rates use the geometric mean calculator.
Common questions
When should I use the harmonic mean?
Use it to average rates measured over the same amount of the thing in the numerator: speeds over equal distances, prices per unit for equal spend, or P/E ratios for equal investments.
Why is the average speed not the ordinary mean of the speeds?
Because you spend longer travelling at the slower speed, so it counts for more. Over equal distances the true average speed is the harmonic mean of the speeds, which is below their ordinary mean whenever the speeds differ.
Can the harmonic mean handle zero or negative numbers?
No. It uses the reciprocal of each value, and 1 ÷ 0 is undefined, so every value must be greater than zero.
Why is my harmonic mean smaller than expected?
The harmonic mean gives more influence to small values: one slow speed pulls the average down more than one fast speed pulls it up. For rates over equal distances or amounts that is the correct answer, because the slow parts take the most time.
How do I calculate this in Excel or Google Sheets?
Use =HARMEAN(A1:A10) with your own range; Google Sheets has the same function. Every value must be greater than zero: Excel returns the #NUM! error for a zero or a negative number.
How does the harmonic mean compare with the other means?
For positive numbers the harmonic mean is never larger than the geometric mean, which is never larger than the arithmetic mean. All three are equal only when the values are identical.
Cite this page
Harmonic Mean Calculator. https://meancalculator.com/harmonic-mean.html